Edgewall Software
Modify

Ticket #7690 (new enhancement)

Opened 3 years ago

Last modified 17 months ago

Add doctype supporting mathml

Reported by: Tim Kerby Owned by: rblank
Priority: high Milestone: next-major-0.1X
Component: rendering Version:
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description (last modified by cboos) (diff)

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

comment:1 Changed 3 years 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 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)

comment:2 follow-up: Changed 3 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 3 years 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.

comment:4 Changed 3 years ago by rblank

  • Milestone set to 0.13
  • Owner set to rblank

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 3 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 2 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 17 months ago by cboos

  • Description modified (diff)

#9194 was closed as duplicate.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from rblank. Next status will be 'new'
The owner will be changed from rblank to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.