Skip to content

[interop] Text fragments + MathML #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dginev opened this issue Apr 28, 2024 · 2 comments
Open

[interop] Text fragments + MathML #240

dginev opened this issue Apr 28, 2024 · 2 comments

Comments

@dginev
Copy link

dginev commented Apr 28, 2024

The URL Fragment Text Directives effort defines an algorithm "find a range from a text directive" which is applicable over nodes. I find the following quote to be a great summary:

The basic premise of this algorithm is to walk all searchable text nodes within a block, collecting them into a list. The list is then concatenated into a single string in which we can search, using the node list to determine offsets with a node so we can return a range.

I am opening this issue to discuss if "a block" is a concept that needs to be extended/refined when that algorithm is executed inside a context.

This could be a very useful refinement, as linking to math-rich fragments is often appropriate when discussing scientific materials.

If there is interest, we can open a mirror issue in the WICG/scroll-to-text-fragment repository. I have checked all repositories for related issues - as far as I am aware this question not been discussed before.


Examples

Successful

Text fragments are available in chromium browsers, where they also match text nodes inside MathML. I will add 3 examples with screenshots.

  1. Link to token element, first instance of

  2. Link to a textual fragment inside

  3. Link to a range, starting at the first det determinant, and upto the end of the closing ) for its matrix.

Unsuccessful

  1. Link to text nodes in adjacent token elements (grandchildren in the same ), fails.

  2. Link to adjacent HTML text node and adjacent inline math , fails

@bkardell
Copy link
Collaborator

bkardell commented May 5, 2025

I am opening this issue to discuss if "a block" is a concept that needs to be extended/refined when that algorithm is executed inside a context.

Why specifically might it be? More or less in Level 1, since we don't have wrapping I guess it relates to mrow-like layout?

@dginev
Copy link
Author

dginev commented May 5, 2025

@bkardell the two "Unsuccessful" examples in the description are a first target of what would be nice to enable:

  • Link to text nodes in adjacent token elements
  • Link to HTML text node and its adjacent inline math token element

So yes, including "mrow-like"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants