8000 Clarify/modify usage of quotes in `<ms>` elements for compatibility with full MathML · Issue #289 · w3c/mathml-core · GitHub
[go: up one dir, main page]

Skip to content

Clarify/modify usage of quotes in <ms> elements for compatibility with full MathML #289

@SmashManiac

Description

@SmashManiac

Related to w3c/mathml#120

MathML 3 and the current working draft for MathML 4 define the lquote and rquote attributes for the <ms> element as surrounding quotes, with a default value of U+0022, and encourage the escaping of quotes inside the element by renderers. Meanwhile, the current iteration of MathML Core deprecates lquote and rquote, and encourages to include the quotes as part of the <ms> content, or to inject them through CSS for legacy documents.

My concerns are as follows:

  1. When an author follows the recommendation to add the surrounding quotes inside the <ms> element, assuming the entire <math> expression does not contain any non-MathML elements or attributes, they can no longer directly export their MathML Core expression to full MathML. They need to first fix it by either removing the surrounding quotes from the contents of each <ms> element, or adding the lquote and 5D61 rquote attributes with blank values to each of them.
  2. When an author follows the recommendation to add the surrounding quotes inside the <ms> element, if they need to add quotes as part of the string literal value, it is unclear how they should proceed. If the author decides to escape the characters manually, not only do they have to arbitrarily decide which escaping grammar to use in order to minimize the confusion, but they would also need to revert the escaping while exporting to full MathML like the previous point.
  3. When importing a full MathML expression that exclusively contain MathML Core elements and attributes, an author must either do the opposite operations as the previous points, or add CSS to inject the quotes as if it was a legacy document despite the potential limitations.

If this incompatibility between the specs cannot be resolved directly, it would be nice if better guidance for authors could be included at the very least.

One possible solution to improve compatibility would be to replace the recommendation of adding surrounding quotes as part of the content of the <ms> element with adding an instruction for user agents to render <ms> elements in monospace by default through CSS. One potential problem would be if an author wants to use a string literal containing non-printable characters or homoglyphs and wants to explicitly write down their Unicode values instead, although I'm not sure if the <ms> element was ever designed for this use case.

Alternatively, <ms> could be removed from MathML Core altogether, since string literals are a programming construct and not a mathematical one, and as a string literal can be easily described as an <mi> element and its corresponding list of integers forming it. This would fully resolve the issue with minimal loss to the language in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0