Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra curlies from xrightarrow #38

Merged
merged 1 commit into from Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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