Closed samuelbradshaw closed 5 months ago
These are my initial thoughts:
*Here is my initial recommendation for a "smaller list of elements" that we should call out as being important to support:
<strong></strong>
, <em></em>
, <sup></sup>
, <sub></sub>
, <mark></mark>
, <span></span>
<a href=""></a>
<br>
(or <br />
in XHTML)<p></p>
, <div></div>
The above list is under the assumption that we could support a class
attribute on HTML elements for styling. If we do not support a class
attribute, then we might add additional formatting elements like these: <b></b>
, <i></i>
, <u></u>
, <strike></strike>
, <big></big>
, <small></small>
what is the point of HTML elements in MNX since no browser will ever support some such kind of thing?
The whole point of HTML tags is that the browsers know how to render them, plus some additional restriction on which child element are allowed for a specific element, for example, tbody
can only have tr
, while div
can have literally anything.
Although the syntax is forgiving (meaning if you supply an invalid child, the page still renders without puking errors at you), some unexpected problems are still there (mainly slot
from web-components family of standards).
The content of the MNX element is always a string, so we can put there literally anything, including standard HTML tags and just feed it to DOMParser
which is available in every browser and get a valid HTML with user-agent styling of elements like strong
, em
etc.
Specific way of rendering a particular element seems like a work for a JS library and is out of scope of the spec for MNX.
what is the point of HTML elements in MNX since no browser will ever support some such kind of thing? The whole point of HTML tags is that the browsers know how to render them, …
Renderers that transform sheet music from MNX to SVG (SVG and HTML Canvas are the two most common technologies I've seen for rendering sheet music on the web) would be able to use the native HTML rendering in a browser by putting the text/HTML content into SVG <foreignObject>
elements (example). This isn't the only reason why I think HTML would be a good standard (see my earlier post) but it's a good side benefit.
We're closing this issue, since we're sure we won't use HTML/XHTML for text encoding in our JSON format, but further discussion about how we _should_ do it is welcome in #345.
Per @mdgood's suggestion in https://github.com/w3c/mnx/issues/278#issuecomment-996919947 to create a separate issue about whether MNX should adopt or borrow from XHTML/HTML, here are three questions that come to mind: