r103242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103241‎ | r103242 | r103243 >
Date:22:10, 15 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Math (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/Math.i18n.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/Math.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/math/html.ml (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/math/lexer.mll (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/math/parser.mly (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/math/tex.mli (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/math/texutil.ml (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Math/mathParserTests.txt (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/Math/mathParserTests.txt
@@ -144,6 +144,24 @@
145145 !! input
146146 <math>\operatorname{sen}</math>
147147 !! result
148 -<p><img class="tex" alt="\operatorname{sen}" src="/images/math/3/e/7/3e71e75d9aac1bf5107271ad89ca7c3b.png" />
 148+<p><img class="tex" alt="\operatorname{sen}" src="/images/math/f/a/9/fa9660c7eb053ca8d3c9a87fa86635d9.png" />
149149 </p>
150150 !! end
 151+
 152+!! test
 153+BUG 31442: Multiple math accents without braces fails to parse
 154+!! input
 155+<math>\dot \vec B</math>
 156+!! result
 157+<p><img class="tex" alt="\dot \vec B" src="/images/math/e/6/4/e64939568ecb506a86a392373cec0458.png" />
 158+</p>
 159+!! end
 160+
 161+!! test
 162+BUG 31442: Math accents with math font fail to parse if braces not used
 163+!! input
 164+<math>\tilde \mathcal{M}</math>
 165+!! result
 166+<p><img class="tex" alt="\tilde \mathcal{M}" src="/images/math/5/5/0/55072ce6ef8c840c4b7687bd8a028bde.png" />
 167+</p>
 168+!! end
Index: branches/wmf/1.18wmf1/extensions/Math/math/html.ml
@@ -56,6 +56,7 @@
5757 | TEX_BOX (_,s)::r -> s^html_render_flat ctx r
5858 | TEX_LITERAL (TEX_ONLY _)::_ -> raise Too_difficult_for_html
5959 | TEX_FUN1 _::_ -> raise Too_difficult_for_html
 60+ | TEX_FUN1nb _::_ -> raise Too_difficult_for_html
6061 | TEX_FUN2 _::_ -> raise Too_difficult_for_html
6162 | TEX_FUN2nb _::_ -> raise Too_difficult_for_html
6263 | TEX_FUN2h _::_ -> raise Too_difficult_for_html
@@ -101,6 +102,7 @@
102103 | TEX_BOX (_,s)::r -> ("",s,"")::html_render_deep ctx r
103104 | TEX_LITERAL (TEX_ONLY _)::_ -> raise Too_difficult_for_html
104105 | TEX_FUN1 _::_ -> raise Too_difficult_for_html
 106+ | TEX_FUN1nb _::_ -> raise Too_difficult_for_html
105107 | TEX_FUN2 _::_ -> raise Too_difficult_for_html
106108 | TEX_FUN2nb _::_ -> raise Too_difficult_for_html
107109 | TEX_FUN2sq _::_ -> raise Too_difficult_for_html
Index: branches/wmf/1.18wmf1/extensions/Math/math/tex.mli
@@ -11,6 +11,7 @@
1212 | TEX_BOX of string * string
1313 | TEX_BIG of string * Render_info.t
1414 | TEX_FUN1 of string * t
 15+ | TEX_FUN1nb of string * t
1516 | TEX_FUN2 of string * t * t
1617 | TEX_FUN2nb of string * t * t
1718 | TEX_INFIX of string * t list * t list
Index: branches/wmf/1.18wmf1/extensions/Math/math/parser.mly
@@ -5,7 +5,7 @@
66 let sq_close_ri = HTMLABLEC(FONT_UFH,"]", "]")
77 %}
88 %token <Render_info.t> LITERAL DELIMITER
9 -%token <string> FUN_AR2 FUN_INFIX FUN_AR1 DECL FUN_AR1opt BIG FUN_AR2nb
 9+%token <string> FUN_AR2 FUN_INFIX FUN_AR1 DECL FUN_AR1nb FUN_AR1opt BIG FUN_AR2nb
1010 %token <string*string> BOX
1111 %token <string*(string*string)> FUN_AR1hl
1212 %token <string*Render_info.font_force> FUN_AR1hf DECLh
@@ -85,6 +85,7 @@
8686 | BIG SQ_CLOSE { TEX_BIG ($1,sq_close_ri) }
8787 | left expr right { TEX_LR ($1,$3,$2) }
8888 | FUN_AR1 lit { TEX_FUN1($1,$2) }
 89+ | FUN_AR1nb lit { TEX_FUN1nb($1,$2) }
8990 | FUN_AR1hl lit { let t,h=$1 in TEX_FUN1hl(t,h,$2) }
9091 | FUN_AR1hf lit { let t,h=$1 in TEX_FUN1hf(t,h,$2) }
9192 | FUN_AR1opt expr_nosqc SQ_CLOSE lit { TEX_FUN2sq($1,TEX_CURLY $2,$4) }
Index: branches/wmf/1.18wmf1/extensions/Math/math/lexer.mll
@@ -56,6 +56,7 @@
5757 | "-" { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH,"-"," &minus; ",MO,str))}
5858 | literal_uf_op { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) }
5959 | delimiter_uf_op { let str = Lexing.lexeme lexbuf in DELIMITER (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) }
 60+ | "\\operatorname" { Texutil.tex_use_ams(); FUN_AR1nb "\\operatorname" }
6061 | "\\sqrt" space * "[" { FUN_AR1opt "\\sqrt" }
6162 | "\\xleftarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xleftarrow" }
6263 | "\\xrightarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xrightarrow" }
Index: branches/wmf/1.18wmf1/extensions/Math/math/texutil.ml
@@ -20,7 +20,8 @@
2121 | TEX_DQN (a) -> "_{" ^ (render_tex a) ^ "}"
2222 | TEX_UQN (a) -> "^{" ^ (render_tex a) ^ "}"
2323 | TEX_LITERAL s -> tex_part s
24 - | TEX_FUN1 (f,a) -> f ^ " " ^ (render_tex a)
 24+ | TEX_FUN1 (f,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}"
 25+ | TEX_FUN1nb (f,a) -> f ^ " " ^ (render_tex a)
2526 | TEX_FUN1hl (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}"
2627 | TEX_FUN1hf (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}"
2728 | TEX_DECLh (f,_,a) -> "{" ^ f ^ "{" ^ (mapjoin render_tex a) ^ "}}"
Index: branches/wmf/1.18wmf1/extensions/Math/Math.i18n.php
@@ -1132,6 +1132,7 @@
11331133 );
11341134
11351135 /** Finnish (Suomi)
 1136+ * @author Crt
11361137 * @author Wix
11371138 */
11381139 $messages['fi'] = array(
@@ -1143,7 +1144,7 @@
11441145 'mw_math_html' => 'Näytä HTML:nä, jos mahdollista, muuten PNG:nä',
11451146 'mw_math_source' => 'Näytä TeX-muodossa (tekstiselaimille)',
11461147 'mw_math_modern' => 'Suositus nykyselaimille',
1147 - 'mw_math_mathml' => 'Näytä MathML:nä jos mahdollista (kokeellinen)',
 1148+ 'mw_math_mathml' => 'Näytä MathML:nä, jos mahdollista (kokeellinen)',
11481149 'math_failure' => 'Jäsentäminen epäonnistui',
11491150 'math_unknown_error' => 'Tuntematon virhe',
11501151 'math_unknown_function' => 'Tuntematon funktio',
@@ -1462,7 +1463,7 @@
14631464 'math_tip' => 'ગણિતિક સૂત્ર (LaTeX)',
14641465 'prefs-math' => 'ગણિત',
14651466 'mw_math_png' => 'PNGને હમેંશા પરત કરો',
1466 - 'mw_math_simple' => 'જો સરળ હોય તો HTML અન્યથા PNG',
 1467+ 'mw_math_simple' => ' જો સરળ હોય તો HTML અન્યથા PNG',
14671468 'mw_math_html' => 'જો સરળ હોય તો HTML અન્યથા PNG',
14681469 'mw_math_source' => 'આને શબ્દ રહેવા દો (ટેક્સ્ટ બ્રાઉઝર)',
14691470 'mw_math_modern' => 'અત્યાધુનિક બ્રાઉઝરો માટે ભલામણ યોગ્ય',
@@ -2829,9 +2830,12 @@
28302831 'prefs-math' => 'Tlapōhualmatiliztli',
28312832 );
28322833
2833 -/** Min Nan Chinese (Bân-lâm-gú) */
 2834+/** Min Nan Chinese (Bân-lâm-gú)
 2835+ * @author Ianbu
 2836+ */
28342837 $messages['nan'] = array(
28352838 'math_sample' => 'Chia siá hong-thêng-sek',
 2839+ 'math_tip' => '數學的公式 (LaTeX)',
28362840 'prefs-math' => 'Sò·-ha̍k ê rendering',
28372841 'mw_math_png' => 'Tiāⁿ-tio̍h iōng PNG render',
28382842 'mw_math_simple' => 'Tân-sûn ê chêng-hêng iōng HTML; kî-thaⁿ iōng PNG',
@@ -3202,12 +3206,12 @@
32033207 'mw_math_modern' => 'HTML - radītan per nāunans lasātlins',
32043208 'mw_math_mathml' => 'MathML ik mazīngi (eksperimentālai)',
32053209 'math_failure' => 'Parsers ni mazēi skaitātun',
3206 - 'math_unknown_error' => 'niwaīsta blānda',
3207 - 'math_unknown_function' => 'niwaīsta funkciōni',
 3210+ 'math_unknown_error' => 'niwaistā blānda',
 3211+ 'math_unknown_function' => 'niwaistā funkciōni',
32083212 'math_lexing_error' => 'laksisis blānda',
32093213 'math_syntax_error' => 'sīntaksis blānda',
3210 - 'math_image_error' => 'Maināsna en PNG ni izpalla.
3211 -Izbāndais, anga latex, dvips, gs be convert ast instalītan tikrōmiskai',
 3214+ 'math_image_error' => 'Mainasnā en PNG ni izpalla.
 3215+Izbandais, anga latex, dvips, gs be convert ast instalītan tikrōmiskai',
32123216 'math_bad_tmpdir' => 'Ni mazīngi teīktun anga enpeisātun en kīsmingiskasmu matemātiskan fōlderin',
32133217 'math_bad_output' => 'Ni mazīngi teīktun anga enpeisātun en izēiseniskasmu matemātiskan fōlderin',
32143218 'math_notexvc' => 'Ni ast texvc prōgraman.
@@ -3358,6 +3362,7 @@
33593363 * @author Emily
33603364 * @author Laurap
33613365 * @author Minisarm
 3366+ * @author Strainu
33623367 */
33633368 $messages['ro'] = array(
33643369 'math_sample' => 'Introduceți formula aici',
@@ -3374,7 +3379,7 @@
33753380 'math_unknown_function' => 'funcție necunoscută',
33763381 'math_lexing_error' => 'eroare lexicală',
33773382 'math_syntax_error' => 'eroare de sintaxă',
3378 - 'math_image_error' => 'Conversiune în PNG eșuată; verificați corectitudinea instalării sistemelor LaTex sau dvipng (sau dvips + gs + convert)',
 3383+ 'math_image_error' => 'Conversie în PNG eșuată; verificați corectitudinea instalării sistemelor LaTex sau dvipng (sau dvips + gs + convert)',
33793384 'math_bad_tmpdir' => 'Nu se poate crea sau nu se poate scrie în directorul temporar pentru formule matematice',
33803385 'math_bad_output' => 'Nu se poate crea sau nu se poate scrie în directorul de ieșire pentru formule matematice',
33813386 'math_notexvc' => 'Lipsește executabilul texvc; vezi math/README pentru configurare.',
Index: branches/wmf/1.18wmf1/extensions/Math/Math.php
@@ -19,6 +19,7 @@
2020
2121 // Extension credits that will show up on Special:Version
2222 $wgExtensionCredits['parserhook'][] = array(
 23+ 'path' => __FILE__,
2324 'name' => 'Math',
2425 'version' => '1.0',
2526 'author' => array( 'Tomasz Wegrzanowski', 'Brion Vibber', '...' ),
@@ -97,4 +98,4 @@
9899
99100 $wgExtensionMessagesFiles['Math'] = $dir . 'Math.i18n.php';
100101
101 -$wgParserTestFiles[] = $dir . 'mathParserTests.txt';
\ No newline at end of file
 102+$wgParserTestFiles[] = $dir . 'mathParserTests.txt';
Property changes on: branches/wmf/1.18wmf1/extensions/Math
___________________________________________________________________
Modified: svn:mergeinfo
102103 Merged /trunk/extensions/Math:r98560,99741,101031,101404,102438,102563,102953,103197

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98560Added path to extension's credits show that it can show SVN revision on Speci...ialex20:55, 30 September 2011
r99741The following patches restore how texvc added braces for all commands...thenub31423:04, 13 October 2011
r101031Localisation updates for core and extension messages from translatewiki.netraymond20:00, 27 October 2011
r101404Localisation updates for core and extension messages from translatewiki.netraymond20:25, 31 October 2011
r102438Localisation updates for core and extension messages from translatewiki.netraymond20:32, 8 November 2011
r102563Localisation updates for core and extension messages from translatewiki.netraymond20:18, 9 November 2011
r102953Localisation updates for core and extension messages from translatewiki.netraymond09:16, 14 November 2011
r103197missing TEX_FUN1nb in html_render_deep()...hashar17:26, 15 November 2011

Status & tagging log