What are phrasing contents? Basically, not block-level stuff, and certainly no <div>s:
However, the output generated from MathJax uses a <div> element which isn't allowed within the <p> element semantically: http://stackoverflow.com/questions/10763780/putting-div-inside-p-is-adding-an-extra-pGood thing that <math> is good though.
On Tuesday, 15 April 2014 16:53:45 UTC+12, William F Hammond wrote:On Mon, Apr 14, 2014 at 6:16 PM, <timt...@gmail.com> wrote:What are phrasing contents? Basically, not block-level stuff, and certainly no <div>s:In HTML 5 <math> is allowed in phrasing content as well as in flow. So <math> is allowed directly in <p> whether its displayed or inline.
If using p you have to just consider it to denote not a paragraph but a text block that forms part of a paragraph together with displayed lists and equations.
In Markdown, lists and tables and such are explicitly block elements and cannot be part of a paragraph. On the other hand, the syntax of math environments exist in a grey area, and it's probably not too late now to consider display math an inline element.
. . . probing the DOCTYPE and use <math> for HTML5, and <span> for HTML4, both with display: block.
<math> was not allowed in HTML4. Do you mean XHTML? HTML5, XHTML5, and XHTML 1.1 + MathML are the major cases today.
OK, I think you're talking about HTML with TeX-like math markup passed through MathJax rather than normal HTML with MathML. For the latter it's not grey. For the former it's the domain of MathJax, and is likely too volatile to try to style on your own. If you want to be able to write your own CSS for math, it might be better to write LaTeX, profiled for either Tex4ht or LaTeXML, which will generate HTML with MathML, and write your CSS for that.
<!DOCTYPE html><html><head><title>Test of p and div</title><style>p {margin-bottom: 1em; background-color:red}p > div {border: 1px solid black}.box {width: 200px; float: left; margin-right:2em}</style></head><body><div class="box"><p>Insert here:<div>Inserted div</div>That was inserted.</p><p>Another paragraph.</p></div><div class="box"><p>Insert here:<span id="insert">Removed</span>That was inserted.</p><p>Another paragraph.</p></div><script>var ins = document.getElementById("insert");var p = ins.parentNode;var div = document.createElement("div");div.innerHTML = "Inserted div";p.insertBefore(div,ins);p.removeChild(ins);</script></body></html>
What I have been doing is to use Mathjax inside a contenteditble. Because of the div tag, I had to build workarounds and now some of the features are just impossible with this kind of arrangement.
Currently is there a way to change the default tag name for display elements?
Otherwise it means I will just have to wait for KaTeX to mature.
--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.