mhchemparser
Advanced tools
Comparing version 4.1.1 to 4.2.0
@@ -5,3 +5,3 @@ /*! | ||
* mhchemParser.ts | ||
* 4.1.1 | ||
* 4.2.0 | ||
* | ||
@@ -15,3 +15,3 @@ * Parser for the \ce command and \pu command for MathJax and Co. | ||
* | ||
* Copyright (c) 2015-2021 Martin Hensel | ||
* Copyright (c) 2015-2023 Martin Hensel | ||
* | ||
@@ -18,0 +18,0 @@ * Licensed under the Apache License, Version 2.0 (the "License"); |
{ | ||
"name": "mhchemparser", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "Parser to convert mhchem syntax to LaTeX syntax, for downstream inclusion in MathJax, KaTeX and similar projects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ "mhchem", "MathJax", "LaTeX", "chemistry" ], |
@@ -115,3 +115,3 @@ interface MhchemParser { | ||
type PatternNameReturningString = | ||
"empty" | "else" | "else2" | "space" | "space A" | "space$" | "a-z" | "x" | "x$" | "i$" | "letters" | "\\greek" | "one lowercase latin letter $" | "$one lowercase latin letter$ $" | "one lowercase greek letter $" | "digits" | "-9.,9" | "-9.,9 no missing 0" | "state of aggregation $" | "{[(" | ")]}" | ", " | "," | "." | ". __* " | "..." | "^{(...)}" | "^($...$)" | "^a" | "^\\x{}" | "^\\x" | "^(-1)" | "\'" | "_{(...)}" | "_($...$)" | "_9" | "_\\x{}{}" | "_\\x{}" | "_\\x" | "^_" | "{}^" | "{}" | "{...}" | "{(...)}" | "$...$" | "${(...)}$__$(...)$" | "=<>" | "#" | "+" | "-$" | "-9" | "- orbital overlap" | "-" | "pm-operator" | "operator" | "arrowUpDown" | "\\bond{(...)}" | "->" | "CMT" | "[(...)]" | "1st-level escape" | "\\," | "\\x{}" | "\\ca" | "\\x" | "orbital" | "others" | "\\color{(...)}" | "\\ce{(...)}" | "\\pu{(...)}" | "oxidation$" | "d-oxidation$" | "roman numeral" | "1/2$" | "amount" | "amount2" | "(KV letters)," | "formula$" | "uprightEntities" | "/" | "//" | "*" | "\\x{}{}" | "^\\x{}{}" | | ||
"empty" | "else" | "else2" | "space" | "space A" | "space$" | "a-z" | "x" | "x$" | "i$" | "letters" | "\\greek" | "one lowercase latin letter $" | "$one lowercase latin letter$ $" | "one lowercase greek letter $" | "digits" | "-9.,9" | "-9.,9 no missing 0" | "state of aggregation $" | "{[(" | ")]}" | ", " | "," | "." | ". __* " | "..." | "^{(...)}" | "^($...$)" | "^a" | "^\\x{}" | "^\\x" | "^(-1)" | "\'" | "_{(...)}" | "_($...$)" | "_9" | "_\\x{}{}" | "_\\x{}" | "_\\x" | "^_" | "{}^" | "{}" | "{...}" | "{(...)}" | "$...$" | "${(...)}$__$(...)$" | "=<>" | "#" | "+" | "-$" | "-9" | "- orbital overlap" | "-" | "pm-operator" | "operator" | "arrowUpDown" | "\\bond{(...)}" | "->" | "CMT" | "[(...)]" | "1st-level escape" | "\\," | "\\x{}" | "\\ca" | "\\x" | "orbital" | "others" | "\\color{(...)}" | "\\ce{(...)}" | "\\pu{(...)}" | "oxidation$" | "d-oxidation$" | "1/2$" | "amount" | "amount2" | "(KV letters)," | "formula$" | "uprightEntities" | "/" | "//" | "*" | "\\x{}{}" | "^\\x{}{}" | | ||
"^{(...)}|^($...$)" | "^a|^\\x{}{}|^\\x{}|^\\x|\'" | "_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x" | "\\,|\\x{}{}|\\x{}|\\x" | "{...}|\\,|\\x{}{}|\\x{}|\\x" | "\\x{}{}|\\x{}|\\x" | "-|+" | "{[(|)]}" | "{...}|else" | "^{(...)}|^(-1)"; | ||
@@ -124,3 +124,3 @@ type PatternNameReturningArray2 = "_{(state of aggregation)}$" | "\\frac{(...)}" | "\\overset{(...)}" | "\\underset{(...)}" | "\\underbrace{(...)}" | "\\color{(...)}{(...)}"; | ||
type ActionNameUsingMNone = "a to o" | "sb=true" | "sb=false" | "beginsWithBond=true" | "beginsWithBond=false" | "parenthesisLevel++" | "parenthesisLevel--" | "output" | "space" | "cdot" | "output-0" | "output-o" | "tight operator"; | ||
type ActionNameUsingMString = "a=" | "b=" | "p=" | "o=" | "q=" | "d=" | "rm=" | "text=" | "copy" | "rm" | "text" | "tex-math" | "tex-math tight" | "ce" | "pu" | "1/2" | "9,9" | "o after d" | "d= kv" | "charge or bond" | "state of aggregation" | "comma" | "oxidation-output" | "r=" | "rdt=" | "rd=" | "rqt=" | "rq=" | "operator" | "bond" | "color0-output" | "roman-numeral" | "^(-1)"; | ||
type ActionNameUsingMString = "a=" | "b=" | "p=" | "o=" | "o=+p1" | "q=" | "d=" | "rm=" | "text=" | "copy" | "rm" | "text" | "tex-math" | "tex-math tight" | "ce" | "pu" | "1/2" | "9,9" | "o after d" | "d= kv" | "charge or bond" | "state of aggregation" | "comma" | "oxidation-output" | "r=" | "rdt=" | "rd=" | "rqt=" | "rq=" | "operator" | "bond" | "color0-output" | "roman-numeral" | "^(-1)"; | ||
type ActionNameUsingMStringOption = "insert" | "insert+p1" | "write" | "bond" | "- after o/d"; | ||
@@ -127,0 +127,0 @@ type ActionNameUsingMArray2 = "insert+p1+p2" | "frac-output" | "overset-output" | "underset-output" | "underbrace-output" | "color-output"; |
@@ -5,3 +5,3 @@ /*! | ||
* mhchemParser.ts | ||
* 4.1.1 | ||
* 4.2.0 | ||
* | ||
@@ -15,3 +15,3 @@ * Parser for the \ce command and \pu command for MathJax and Co. | ||
* | ||
* Copyright (c) 2015-2021 Martin Hensel | ||
* Copyright (c) 2015-2023 Martin Hensel | ||
* | ||
@@ -312,5 +312,4 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
'\\pu{(...)}': function (input) { return _mhchemParser.patterns.findObserveGroups(input, "\\pu{", "", "", "}"); } as PatternFunction<string>, | ||
'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/, | ||
'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/, // 0 could be oxidation or charge | ||
'roman numeral': /^[IVX]+/, | ||
'oxidation$': /^(?:[+-][IVX]+|(?:\\pm|\$\\pm\$|\+-|\+\/-)\s*0)$/, // -IV to +IX, +-0 // "0" could be oxidation or charge - but renders the same | ||
'd-oxidation$': /^(?:[+-]?[IVX]+|(?:\\pm|\$\\pm\$|\+-|\+\/-)\s*0)$/, | ||
'1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/, | ||
@@ -439,2 +438,3 @@ 'amount': function (input) { | ||
'o=': function (buffer, m) { buffer.o = (buffer.o || "") + m; return undefined; }, | ||
'o=+p1': function (buffer, _m, a: string) { buffer.o = (buffer.o || "") + a; return undefined; }, | ||
'q=': function (buffer, m) { buffer.q = (buffer.q || "") + m; return undefined; }, | ||
@@ -1014,12 +1014,10 @@ 'd=': function (buffer, m) { buffer.d = (buffer.d || "") + m; return undefined; }, | ||
'empty': { | ||
'*': { action_: [] } }, | ||
'roman numeral': { | ||
'*': { action_: 'roman-numeral' } }, | ||
'${(...)}$__$(...)$': { | ||
'*': { action_: 'tex-math' } }, | ||
'pm-operator': { | ||
'*': { action_: { type_: 'o=+p1', option: "\\pm" } } }, | ||
'else': { | ||
'*': { action_: 'copy' } } | ||
'*': { action_: 'o=' } } | ||
}), | ||
actions: { | ||
'roman-numeral': function (_buffer, m) { return { type_: 'roman numeral', p1: m }; } | ||
'roman-numeral': function (buffer) { return { type_: 'roman numeral', p1: buffer.o || "" }; } | ||
} | ||
@@ -1026,0 +1024,0 @@ }, |
@@ -13,3 +13,3 @@ { | ||
"sourceMap": false, | ||
"outDir": "dist", | ||
"outDir": "dist" | ||
}, | ||
@@ -20,2 +20,2 @@ "files": [ | ||
] | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
276568
13
5464