Skip to content
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

[interop] Text fragments + MathML #240

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

[interop] Text fragments + MathML #240

dginev opened this issue Apr 28, 2024 · 0 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 <math> 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 <math> 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 <mi>ℝ</mi>

  2. Link to a textual fragment inside <mtext>

  3. Link to a range, starting at the first <mi>det</mi> 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 <mrow>), fails.

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

@dginev dginev transferred this issue from w3c/mathml Apr 28, 2024
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

1 participant