Why no ASCIIMath as child of FORM element?

13 views
Skip to first unread message

Dean Brettle

unread,
Jun 29, 2010, 3:22:38 AM6/29/10
to ASCIIMath
Hi all,

Starting at line 850 in ASCIIMathML.js version 2.0.2, I see:

if ((n.nodeType!=8 || linebreaks) &&
n.parentNode.nodeName!="form" && n.parentNode.nodeName!="FORM" &&
n.parentNode.nodeName!="textarea" && n.parentNode.nodeName!
="TEXTAREA" &&
n.parentNode.nodeName!="pre" && n.parentNode.nodeName!="PRE") {
... process the ASCIIMath ...

I understand why you wouldn't want to process ASCIIMath within a
TEXTAREA or a PRE, but why not within a FORM element. I have a set of
<INPUT type=radio> choices, each of which is ASCIIMath, and they
aren't getting converted because they happen to all be children of the
FORM element. Removing the second line above, fixes the problem.

--Dean

David Lippman

unread,
Jul 13, 2010, 5:04:03 PM7/13/10
to ASCIIMath
I have no idea what the history of that line is, but it only affects a
node if it is the direct descendant of a form node, which is probably
why I've never run into a problem with it, even though I have tons of
math inside forms on my sites.

Looking into it closer, it appears a #text node is created inside most
container nodes (like divs), so if you have code like <form><div>test
`x^3/3`</div></form> then things render just fine. But <form>test
`x^3/3`</form> does not work.

-David
Reply all
Reply to author
Forward
0 new messages