Skip to:
Content
Pages
Categories
Search
Top
Bottom

MathML and BBpress

  • @dprice

    Member

    Ok, I’ve been poking around the forums, found out how to get new allowed tags (thanks to Louise Dade + others) and now want to add MathML tag support, so users can post MathML.

    A big problem is that the editor box seems to add line break <br /> tags to every line – how do you turn this off?

    The array I’m using in the plugin is:

    `$tags = array(

    // XHTML elements:

    'a' => array(

    'href' => array(),

    'hreflang' => array(),

    'title' => array(),

    'rel' => array(),

    'xml:lang' => array()),

    'abbr' => array('title' => array()),

    'acronym' => array('title' => array()),

    'b' => array(),

    'bdo' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'blockquote' => array('cite' => array()),

    'br' => array(),

    'code' => array(),

    // 'del' => array('datetime' => array()),

    'dd' => array(),

    'dl' => array(),

    'div' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'dt' => array(),

    'em' => array(),

    'i' => array(

    'dir' => array(),

    'xml:lang' => array()),

    // 'ins' => array('datetime' => array(), 'cite' => array()),

    'li' => array(),

    'ol' => array(),

    'p' => array(),

    'pre' => array(),

    // 'q' => array(),

    // 'strike' => array(),

    'span' => array(

    'dir' => array(),

    'xml:lang' => array()),

    'strong' => array(),

    'sub' => array(),

    'sup' => array(),

    'u' => array(),

    'ul' => array(),

    // MathML elements:

    'math' => array(

    'xmlns' => array(),

    'mode' => array()),

    'mo' => array(

    'lspace' => array(),

    'rspace' => array(),

    'fence' => array(),

    'separator' => array()),

    'mi' => array('mathvariant' => array()),

    'msub' => array(),

    'msup' => array(),

    'msubsup' => array(),

    'mfrac' => array('linethickness' => array()),

    'mn' => array(),

    'mstyle' => array(

    'scriptlevel' => array(),

    'fontstyle' => array(),

    'fontweight' => array(),

    'mathvariant' => array(),

    'displaystyle' => array()),

    'mtext' => array(),

    'mspace' => array(

    'width' => array(),

    'height' => array(),

    'depth' => array()),

    'msqrt' => array(),

    'mmultiscripts' => array(),

    'mprescripts' => array(),

    'none' => array(),

    'mroot' => array(),

    'mphantom' => array(),

    'merror' => array(),

    'mover' => array(),

    'munder' => array(),

    'munderover' => array(),

    'maction' => array(

    'actiontype' => array(),

    'other' => array(),

    'selection' => array()),

    'mtable' => array(

    'align' => array(),

    'columnalign' => array(),

    'rowalign' => array(),

    'equalrows' => array(),

    'equalcolumns' => array(),

    'columnspacing' => array(),

    'rowspacing' => array(),

    'columnlines' => array(),

    'rowlines' => array(),

    'frame' => array()),

    'mrow' => array(

    'xlink:type' => array(),

    'xlink:show' => array(),

    'xlink:href' => array()),

    'mtr' => array(

    'rowalign' => array(),

    'columnalign' => array()),

    'mtd' => array(

    'rowspan' => array(),

    'columnspan' => array(),

    'rowalign' => array(),

    'columnalign' => array()),

    'mpadded' => array('width' => array())

    );

    return $tags;

    }`

    If anyone’s interested, you can find install at http://www.thetelegraphic.com/bbpress/bbpress/ (for now, once it’s fully working it’ll go to a dedicated domain).

Viewing 2 replies - 1 through 2 (of 2 total)
  • @trent

    Member

    My guess would be that it would be in /bb-includes/formatingfunctions.php somewhere, but I am not sure….

    Trent

    @dprice

    Member

    I’ve found a way around this finally, and will be posting up a ‘math-pack’ version of BBpress. I did have to edit /bb-includes/formattingfunctions.php (2 lines – commented out a regular expression).

    Basically, the way I came up with was using ASCIIMath.js to replace stuff in backticks. I’ll get a zip up when I have the time (actually hacing to do the maths uses up most of my time)

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar