Skip to content

Commit

Permalink
Remove extra curlies from xrightarrow
Browse files Browse the repository at this point in the history
  • Loading branch information
physikerwelt committed Apr 4, 2020
1 parent d6f4024 commit 68f1ae3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
2 changes: 0 additions & 2 deletions .istanbul.yml

This file was deleted.

20 changes: 11 additions & 9 deletions lib/texutil.js
Expand Up @@ -696,9 +696,9 @@ module.exports.fun_ar1 = arr2set([
'\\vec',
'\\widehat',
'\\widetilde',
'\\xcancel',
'\\xleftarrow',
'\\xrightarrow'
'\\xcancel'
// '\\xleftarrow', // moved to fun_ar1nb
// '\\xrightarrow' // moved to fun_ar1nb
]);

module.exports.fun_mhchem = arr2set([
Expand All @@ -718,7 +718,9 @@ module.exports.fun_ar1nb = arr2set([
'\\mathbb',
'\\mathbf',
'\\mathrm',
'\\underbrace'
'\\underbrace',
'\\xleftarrow',
'\\xrightarrow'
]);

module.exports.fun_ar1opt = arr2set([
Expand Down Expand Up @@ -756,11 +758,11 @@ module.exports.declh_function = arr2set([
'\\bf'
]);

module.exports.left_function = arr2set([ '\\left' ]);
module.exports.right_function = arr2set([ '\\right' ]);
module.exports.hline_function = arr2set([ '\\hline' ]);
module.exports.definecolor_function = arr2set([ '\\definecolor' ]);
module.exports.color_function = arr2set([ '\\color', '\\pagecolor' ]);
module.exports.left_function = arr2set(['\\left']);
module.exports.right_function = arr2set(['\\right']);
module.exports.hline_function = arr2set(['\\hline']);
module.exports.definecolor_function = arr2set(['\\definecolor']);
module.exports.color_function = arr2set(['\\color', '\\pagecolor']);

// ------------------------------------------------------
// Package dependencies for various allowed commands.
Expand Down
11 changes: 5 additions & 6 deletions package.json
@@ -1,11 +1,11 @@
{
"name": "mathoid-texvcjs",
"version": "0.3.8",
"description": "A TeX/LaTeX validator for mediawiki.",
"version": "0.3.9",
"description": "A TeX/LaTeX validator for MediaWiki.",
"main": "lib/index.js",
"scripts": {
"build": "node -e 'require(\"./lib/build-parser\")'",
"cover": "nyc --reporter=lcov _mocha",
"cover": "nyc --reporter=lcov --exclude lib/parser.js_mocha ",
"lint": "eslint --max-warnings 0 --ext .js .",
"test": "node -e 'require(\"./lib/build-parser\")' && npm run lint && mocha",
"report-coverage": "cat ./coverage/lcov.info | coveralls"
Expand All @@ -26,14 +26,13 @@
"url": "https://phabricator.wikimedia.org/project/profile/1771/"
},
"dependencies": {
"commander": "~4.1.1"
"commander": "~5.0.0"
},
"devDependencies": {
"coveralls": "^3.0.11",
"nyc": "^15.0.0",
"eslint-config-wikimedia": "^0.15.0",
"istanbul": "^0.4.5",
"mocha": "~7.0.1",
"mocha": "~7.1.1",
"mocha-lcov-reporter": "^1.3.0",
"pegjs": "~0.10.0"
},
Expand Down
13 changes: 8 additions & 5 deletions test/all.js
Expand Up @@ -299,7 +299,7 @@ describe('Comprehensive test cases', function () {
'\\overline{A}\\overrightarrow{A}\\pmod{A}\\sqrt{A}' +
'\\textbf{A}\\textit{A}\\textrm{A}\\textsf{A}\\texttt{A}' +
'\\tilde{A}\\underline{A}\\vec{A}\\widehat{A}\\widetilde{A}' +
'\\xcancel{A}\\xleftarrow{A}\\xrightarrow{A}',
'\\xcancel{A}',
output:
'{\\acute {A}}{\\bar {A}}{\\bcancel {A}}{\\bmod {A}}' +
'{\\boldsymbol {A}}{\\breve {A}}{\\cancel {A}}{\\check {A}}' +
Expand All @@ -313,8 +313,7 @@ describe('Comprehensive test cases', function () {
'{\\overrightarrow {A}}{\\pmod {A}}{\\sqrt {A}}' +
'{\\textbf {A}}{\\textit {A}}{\\textrm {A}}{\\textsf {A}}' +
'{\\texttt {A}}{\\tilde {A}}{\\underline {A}}{\\vec {A}}' +
'{\\widehat {A}}{\\widetilde {A}}{\\xcancel {A}}' +
'{\\xleftarrow {A}}{\\xrightarrow {A}}',
'{\\widehat {A}}{\\widetilde {A}}{\\xcancel {A}}',
skipOcaml: 'double spacing and extra braces'
},
'FUN_AR1 (2)': {
Expand All @@ -336,15 +335,19 @@ describe('Comprehensive test cases', function () {
input: '\\overbrace {A} _{b}^{c}\\underbrace {C} _{d}^{e}',
skipOcaml: 'ocaml bug'
},
'FUN_AR1NB (4)': {
input: '\\xleftarrow{A}\\xrightarrow{A}',
output: '\\xleftarrow {A} \\xrightarrow {A} '
},
FUN_AR1OPT: {
input:
'\\sqrt{2}\\sqrt[3]{2}' +
'\\xleftarrow{above}\\xleftarrow[below]{above}' +
'\\xrightarrow{above}\\xrightarrow[below]{above}',
output:
'{\\sqrt {2}}{\\sqrt[{3}]{2}}' +
'{\\xleftarrow {above}}{\\xleftarrow[{below}]{above}}' +
'{\\xrightarrow {above}}{\\xrightarrow[{below}]{above}}',
'\\xleftarrow {above} {\\xleftarrow[{below}]{above}}' +
'\\xrightarrow {above} {\\xrightarrow[{below}]{above}}',
skipOcaml: 'spacing'
},
FUN_AR2: {
Expand Down

0 comments on commit 68f1ae3

Please sign in to comment.