Edgewall Software

Opened 10 years ago

Last modified 3 years ago

#7690 new enhancement

Add doctype supporting mathml

Reported by: Tim Kerby Owned by:
Priority: normal Milestone: next-major-releases
Component: rendering Version:
Severity: normal Keywords:
Release Notes:
API Changes:

Description (last modified by Christian Boos)

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 (0)

Change History (9)

comment:1 Changed 10 years ago by Emmanuel Blot

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 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"

but this breaks IE6 (at least)

comment:2 Changed 10 years 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.

comment:3 in reply to:  2 Changed 10 years ago by Emmanuel Blot

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.

comment:4 Changed 10 years ago by Remy Blank

Milestone: 0.13
Owner: set to Remy Blank

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

comment:5 Changed 10 years ago by anonymous

Maybe it'd be a better idea to give plugins the necessary hooks to do a doctype or mime type change. I wouldn't want that kind of doctype if I don't intend to use SVG or MathML.

comment:6 Changed 9 years ago by Carsten Klein <carsten.klein@…>

Apart from being able to change the mimetype of the document, simply forget IE <8, please. Force users to upgrade.

comment:7 Changed 8 years ago by Christian Boos

Description: modified (diff)

#9194 was closed as duplicate.

comment:8 Changed 7 years ago by Remy Blank

Owner: Remy Blank deleted


comment:9 Changed 3 years ago by figaro

Priority: highnormal
Last edited 3 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set.
The owner will be changed from (none) to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.