Page MenuHomePhabricator

change texvc's HTML rendering of "-" to "−"
Closed, ResolvedPublic

Description

Author: mark_sweep

Description:
Currently, texvc renders <math>A-B</math> with a hyphen (" - ") instead of a
minus sign (" &minus; "). Use of the minus sign should be preferred for math
display. The following diff will fix this by adding one line to the lexer:

cvs diff -u

cvs diff: Diffing .

Index: lexer.mll

RCS file: /cvsroot/wikipedia/phase3/math/lexer.mll,v
retrieving revision 1.2
diff -u -r1.2 lexer.mll

  • lexer.mll 19 May 2003 22:40:16 -0000 1.2

+++ lexer.mll 26 Feb 2005 00:20:35 -0000
@@ -47,6 +47,7 @@

| 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; "))}

| 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) }

Version: unspecified
Severity: minor

Details

Reference
bz1594
ReferenceSource BranchDest BranchAuthorTitle
repos/releng/jenkins-deploy!49T359415masterjnuchejenkins-rel: updating plugin versions to address vulnerabilities
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:14 PM
bzimport added a project: Math.
bzimport set Reference to bz1594.
bzimport added a subscriber: Unknown Object (MLST).

zigger wrote:

Patch applied by Jens.

jeluf wrote:

Cache still contains HTML generated with old texvc revision.

Found while doing general math testing:

This seems to render "-3" as " &minus; 3" in HTML mode, which renders with an extra space.

sumanah wrote:

Marking patch as reviewed per Brion's comment 4.