Itex2MML
From MediaWiki 1.15.2
Contents |
Instructions for enabling itex2MML for WordPress 2.3
These are my temporary notes on how I have enabled itex2MML for my WordPress 2.3 installation. These instructions are based on the work of Frederick Leitner and Jacques Distler
WordPress 2.3 file changes
I have been able to enable itex2MML for WordPress 2.3 by doing the following changes:
- wp-includes/classes.php
- wp-includes/formatting.php
- the header creator in your theme must be changed.
- itexToMML must be updated to latest recommendations of the W3C.
- plugin for WordPress by Jacques Distler
Changes to wp-includes/classes.php
The function send_headers was modified. Here is the diff between the official release and my changes:
174,176d173
< if ( !is_user_logged_in() )
< nocache_headers();
< @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
178c175,183
< @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
---
>
> if ( (preg_match("/Mozilla|Gecko|W3C_Validator|MathPlayer/", $_SERVER["HTTP_USER_AGENT"])
> && !preg_match("/Chimera|Camino|KHTML/",$_SERVER["HTTP_USER_AGENT"]))
> || preg_match("/Camino.*MathML-Enabled/", $_SERVER["HTTP_USER_AGENT"]) ) {
> header("Content-type: application/xhtml+xml; charset=utf-8");
> } else {
> header("Content-type: text/html; charset=utf-8");
> }
>
Changes to wp-includes/formatting.php
The choice 'math' must be erased from the 'allblocks' variable.
