BUG 1594 Render a hyphen in a formula as − in HTML
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 13 Mar 2005 15:37:09 +0000 (15:37 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 13 Mar 2005 15:37:09 +0000 (15:37 +0000)
Better patch than the first try. Allows A-B to be rendered as MathML or as HTML

math/lexer.mll

index a08677c..e5bb1dd 100644 (file)
@@ -47,7 +47,7 @@ rule token = parse
   | literal_mn                 { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_RM, str,str,MN,str)) }
   | literal_uf_lt              { let str = Lexing.lexeme lexbuf in LITERAL (HTMLABLEC (FONT_UFH, str,str)) }
   | delimiter_uf_lt            { let str = Lexing.lexeme lexbuf in DELIMITER (HTMLABLEC (FONT_UFH, str,str)) }
-  | "-"                                { LITERAL (HTMLABLE (FONT_UFH,"-"," &minus; "))}
+  | "-"                                { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH,"-"," &minus; ",MO,str))}
   | literal_uf_op              { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) }
   | delimiter_uf_op            { let str = Lexing.lexeme lexbuf in DELIMITER (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) }
   | "\\" alpha +               { Texutil.find (Lexing.lexeme lexbuf) }