diff --git a/package.json b/package.json index 109869773b..293ebeee0b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "imports-loader": "0.8.0", "jquery": "3.4.1", "jquery-validation": "1.19.0", - "katex": "0.8.3", + "katex": "0.10.2", "lazysizes": "4.1.6", "mini-css-extract-plugin": "0.4.0", "moment": "2.24.0", diff --git a/yarn.lock b/yarn.lock index e44ed64910..f30778757e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6019,12 +6019,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -katex@0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.8.3.tgz#909d99864baf964c3ccae39c4a99a8e0fb9a1bd0" - integrity sha512-0VKw+G/wvgLKMy4fhhKdPGjXehYF3l3PBRdzkvBivK5wMtAH9xRHImQaGk9gaukBTdOfZ1Biq8kL5vgkUsBT0Q== +katex@0.10.2: + version "0.10.2" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.10.2.tgz#39973edbb65eda5b6f9e7f41648781e557dd4932" + integrity sha512-cQOmyIRoMloCoSIOZ1+gEwsksdJZ1EW4SWm3QzxSza/QsnZr6D4U1V9S4q+B/OLm2OQ8TCBecQ8MaIfnScI7cw== dependencies: - match-at "^0.1.0" + commander "^2.19.0" kdbush@^1.0.1: version "1.0.1" @@ -6417,11 +6417,6 @@ mat4-recompose@^1.0.3: dependencies: gl-mat4 "^1.0.1" -match-at@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540" - integrity sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q== - math-log2@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-log2/-/math-log2-1.0.1.tgz#fb8941be5f5ebe8979e718e6273b178e58694565" diff --git a/zerver/tests/fixtures/markdown_test_cases.json b/zerver/tests/fixtures/markdown_test_cases.json index fd7d7ba823..4da6647488 100644 --- a/zerver/tests/fixtures/markdown_test_cases.json +++ b/zerver/tests/fixtures/markdown_test_cases.json @@ -70,8 +70,8 @@ { "name": "fenced_quotes_inside_mathblock", "input": "```math\n````js\nvar x;\n````\n```", - "expected_output": "

jsvarx;````js\nvar x;\n````jsvarx;

", - "marked_expected_output": "jsvarx;````js\nvar x;\n````jsvarx;" + "expected_output": "

jsvarx;````js\nvar x;\n````jsvarx;

", + "marked_expected_output": "jsvarx;````js\nvar x;\n````jsvarx;" }, { "name": "empty_single_blockquote", @@ -653,12 +653,12 @@ { "name": "tex_inline", "input": "$$1 \\oplus 0 = 1$$", - "expected_output": "

10=11 \\oplus 0 = 110=1

" + "expected_output": "

10=11 \\oplus 0 = 110=1

" }, { "name": "tex_complex", "input": "$$\\Phi_E = \\oint E \\cdot dA$$", - "expected_output": "

ΦE=EdA\\Phi_E = \\oint E \\cdot dAΦE=EdA

" + "expected_output": "

ΦE=EdA\\Phi_E = \\oint E \\cdot dAΦE=EdA

" }, { "name": "tex_escaped", @@ -668,30 +668,30 @@ { "name": "tex_fenced_math", "input": "```math\na^2 = b^2 + c^2\n```", - "expected_output": "

a2=b2+c2a^2 = b^2 + c^2a2=b2+c2

", - "marked_expected_output": "a2=b2+c2a^2 = b^2 + c^2a2=b2+c2" + "expected_output": "

a2=b2+c2a^2 = b^2 + c^2a2=b2+c2

", + "marked_expected_output": "a2=b2+c2a^2 = b^2 + c^2a2=b2+c2" }, { "name": "tex_fenced_tex", "input": "```tex\n\n\\pi \\textbf{ is not } 3.14\n```", - "expected_output": "

π is not 3.14\n\\pi \\textbf{ is not } 3.14π is not 3.14

", - "marked_expected_output": "π is not 3.14\n\\pi \\textbf{ is not } 3.14π is not 3.14" + "expected_output": "

π is not 3.14\n\\pi \\textbf{ is not } 3.14π is not 3.14

", + "marked_expected_output": "π is not 3.14\n\\pi \\textbf{ is not } 3.14π is not 3.14" }, { "name": "tex_fenced_latex", "input": "```latex\n\n\\frac{1}{\\sqrt{2}}\n\\begin{bmatrix}\n1 & 1 \\\\\n1 & -1\n\\end{bmatrix}\n```", - "expected_output": "

12[1111]\n\\frac{1}{\\sqrt{2}}\n\\begin{bmatrix}\n1 & 1 \\\\\n1 & -1\n\\end{bmatrix}2\n 1[1111]

", - "marked_expected_output": "12[1111]\n\\frac{1}{\\sqrt{2}}\n\\begin{bmatrix}\n1 & 1 \\\\\n1 & -1\n\\end{bmatrix}2\n 1[1111]" + "expected_output": "

12[1111]\n\\frac{1}{\\sqrt{2}}\n\\begin{bmatrix}\n1 & 1 \\\\\n1 & -1\n\\end{bmatrix}21[1111]

", + "marked_expected_output": "12[1111]\n\\frac{1}{\\sqrt{2}}\n\\begin{bmatrix}\n1 & 1 \\\\\n1 & -1\n\\end{bmatrix}21[1111]" }, { "name": "tex_money", "input": "Tickets are $5 to $20 for youth, $10-$30 for adults, so we are hoping to bring in $500 from the event ($$x \\approx 500\\$$$)", - "expected_output": "

Tickets are $5 to $20 for youth, $10-$30 for adults, so we are hoping to bring in $500 from the event (x500$x \\approx 500\\$x500$)

" + "expected_output": "

Tickets are $5 to $20 for youth, $10-$30 for adults, so we are hoping to bring in $500 from the event (x500$x \\approx 500\\$x500$)

" }, { "name": "tex_inline_permissive_spacing", "input": "$$ x = 7 $$", - "expected_output": "

x=7 x = 7 x=7

" + "expected_output": "

x=7 x = 7 x=7

" }, { "name": "tex_inline_prohibited_newline", @@ -716,8 +716,8 @@ { "name": "tex_safe_script_tag", "input": "$$$$\n\n~~~math\n\n~~~", - "expected_output": "

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

\n

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

", - "marked_expected_output": "

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

\n<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>" + "expected_output": "

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

\n

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

", + "marked_expected_output": "

<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>

\n<scripttype=text/javascript>alert(xss);</script><script type='text/javascript'>alert('xss');</script><scripttype=text/javascript>alert(xss);</script>" }, { "name": "tex_error_safe_script_tag",