Edgewall Software

Ticket #7690 (new enhancement)

Opened 3 months ago

Last modified 3 months ago

Add doctype supporting mathml

Reported by: Tim Kerby Owned by: rblank
Priority: high Milestone: 0.13
Component: rendering Version:
Severity: normal Keywords:
Cc:

Description

I've been trying to add support for mathml in the Trac wiki. We work on the development of algorithms for imaging and the inclusion of equations into tickets and the wiki would be extremely useful.

I think that we can do this by using the commands to embed html into the wiki markup then cutting and pasting mathml from an editor. The issue is that genshi doesnt support a suitable doctype and there is also no way of setting the doctype on a per project basis

Ideally, I would like the following definition to be available so that math code can be pasted into the wiki

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"

"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [

<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">

]>

Attachments

Change History

  Changed 3 months ago by eblot

Maybe you can do this with the site-template.html customization file.

However, I don't think (to be checked) that redefining the doctype would suffice:
the HTTP Content-Type header would probably need to be changed as well:

Trac returns text/html, whereas application/xhtml+xml would be required to properly parse MathML document.

The trouble is that this kind of Content-Type document does not work with older browsers, such as IE6, AFAIR.

For example, the TracHacks:RevtreePlugin returns application/xhtml+xml content type, as it needs to embed SVG code into the XML stream:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
  "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> 

but this breaks IE6 (at least)

follow-up: ↓ 3   Changed 3 months ago by ebray

Of course, I doubt MathML works in IE6, so that's probably not a concern ;) Not sure about changing the doctype declaration, but you can use a simple request filter to set the content type on all requests (or at least the relevant ones) to application/xhtml+xml.

in reply to: ↑ 2   Changed 3 months ago by eblot

Replying to ebray:

Of course, I doubt MathML works in IE6, so that's probably not a concern ;)

It could be, if the request is to include such a change in Trac Core - if Trac had to send application/xhtml+xml for instance.

  Changed 3 months ago by rblank

  • owner set to rblank
  • milestone set to 0.13

Equations in wiki pages would be nice, SVG too. I'd like to look into this, unless somebody beats me to it.

Add/Change #7690 (Add doctype supporting mathml)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from rblank. Next status will be 'new'
The owner will change from rblank to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.