MultiMarkdown and MathML - new feature and request for help

Michel Fortin michel.fortin at michelf.com
Sun Jun 11 22:55:13 EDT 2006


Le 10 juin 2006 à 19:53, Fletcher T. Penney a écrit :


> On Jun 10, 2006, at 7:18 PM, Michel Fortin wrote:

>

>> Le 10 juin 2006 à 17:02, Fletcher T.Penney a écrit :

>>

>>> 1) How can I create a valid document with a .html extension?

>>> (requiring .xhtml is going to break a bunch of other stuff)

>>

>> MathML (or any other XML language for that matter) is not

>> recognized when the browser parse the file with the HTML parser.

>> So for MathML to work, you need ".xhtml" or a "application/xhtml

>> +xml" MIME type. And yes, unfortunately, that can break other stuff.

>

> Placing

>

> <meta http-equiv="content-type" content="application/xhtml+xml" />

>

> in the .html file doesn't work (I had already tried...) Is there

> another way around this, or must the extension be .xhtml? Surely

> something as simple as a filename extension is not this important

> on the web in 2006...


When I talked about the MIME type, I was really talking about the
HTTP "Content-Type" header sent by the web server. Using a <meta>
element does not trigger the browser into using the XML parser, but
having a ".xhtml" will make most servers send the right content-type.

If your problem is really the file extension, a server could be
configured to send a ".html" file just like if it was
".xhtml" (sending the "application/xhtml+xml" content type).

If the problem is how the browser handles the page when parsed as
XML, I'm afraid there is no way around this that I know of. Either
you use the XML parser and MathML does work in Firefox, either you
use the HTML parser and MathML does not work.

I'd point out that a discussion list about Markdown may not be the
best place to ask about problems browsers have with XML parsing and
MathML content; you could probably get better answers elsewhere.



>> Instead, try to answer this question: how to specify an XML

>> namespace from the stylesheet?

>

> Ok, I'll bite... So how does one do this?


I have no idea. I'm sure it's pretty simple as XSL was built for XML
and namespaces are a so important concept of XML, but I've almost no
experience with XSL. I was only giving you something more precise for
your search.



>>> 3) Any suggestions on the markup syntax? I sort of arbitrarily

>>> chose the use of an extra `. I am sure there is a better way of

>>> doing this, and would love to hear input.

>>

>> Well, if you want to be sure Markdown doesn't change the content

>> of your expression, you could wrap it into a processing

>> instruction tag:

>>

>> <?ascii2math x_(1,2) = (-b+-sqrt(b^2-4ac))/(2a) ?>

>>

>> This is less pretty, but has less chance to break too. With your

>> syntax, what happens if you have some `<` in a formula? With the

>> one above, only `?>` would be problematic, but you shouldn't see

>> that too often in maths.

>

> Definitely less pretty. I have no desire to require something like

> "<?ascii2math ... ?>". This is clearly not what Gruber intended

> when he wrote, "without looking like it’s been marked up with tags

> or formatting instructions." And this is exactly what I have tried

> to avoid with MultiMarkdown-specific markup. I don't mind an

> unobtrusive quotation mark or two, but want to avoid things that

> look remotely like "programming"...

>

> As for the "<" issue, I don't follow. There is no use of "<" or

> ">" in my current ascii2math syntax, and those symbols work just fine.


Well, I'm happy to know it works. Somehow I thought you were parsing
Markdown before math blocks (that should have caused that result). By
rereading your first mail, I see that ASCII2Math runs before
Markdown, so that problem won't be there and my suggestion of using a
processing instruction tag becomes irrelevant.

As John pointed out, your syntax conflicts somewhat with Markdown
already, and I'd also bet that you can't put an example of your math
syntax inside a code block or a code span without having it
transformed with tags (because math is being handled before code
spans and code blocks). That will be hard to avoid unless you add a
new step inside Markdown for math processing. Depending on what you
intend to do with this, the issue may or may not have much importance
however.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/



More information about the Markdown-Discuss mailing list