remark-math
Advanced tools
Comparing version 5.0.0 to 5.1.0
/** | ||
* Plugin to support math. | ||
* | ||
* @type {import('unified').Plugin<void[], Root>} | ||
* @type {import('unified').Plugin<[Options?] | void[], Root, Root>} | ||
*/ | ||
export default function remarkMath(): | ||
export default function remarkMath( | ||
options?: void | import('mdast-util-math').ToOptions | undefined | ||
): | ||
| void | ||
| import('unified').Transformer<import('mdast').Root, import('mdast').Root> | ||
export type Root = import('mdast').Root | ||
export type Options = import('mdast-util-math').ToOptions | ||
export type DoNotTouchAsThisImportIncludesMathInTree = | ||
typeof import('mdast-util-math') |
11
index.js
/** | ||
* @typedef {import('mdast').Root} Root | ||
* @typedef {import('mdast-util-math').ToOptions} Options | ||
* | ||
@@ -13,10 +14,10 @@ * @typedef {import('mdast-util-math')} DoNotTouchAsThisImportIncludesMathInTree | ||
* | ||
* @type {import('unified').Plugin<void[], Root>} | ||
* @type {import('unified').Plugin<[Options?] | void[], Root, Root>} | ||
*/ | ||
export default function remarkMath() { | ||
export default function remarkMath(options = {}) { | ||
const data = this.data() | ||
add('micromarkExtensions', math) | ||
add('fromMarkdownExtensions', mathFromMarkdown) | ||
add('toMarkdownExtensions', mathToMarkdown) | ||
add('micromarkExtensions', math(options)) | ||
add('fromMarkdownExtensions', mathFromMarkdown()) | ||
add('toMarkdownExtensions', mathToMarkdown(options)) | ||
@@ -23,0 +24,0 @@ /** |
{ | ||
"name": "remark-math", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "remark plugin to parse and stringify math", | ||
@@ -39,4 +39,4 @@ "license": "MIT", | ||
"@types/mdast": "^3.0.0", | ||
"mdast-util-math": "^1.0.0", | ||
"micromark-extension-math": "^1.0.0", | ||
"mdast-util-math": "^2.0.0", | ||
"micromark-extension-math": "^2.0.0", | ||
"unified": "^10.0.0" | ||
@@ -43,0 +43,0 @@ }, |
@@ -91,2 +91,11 @@ # remark-math | ||
##### `options` | ||
###### `options.singleDollarTextMath` | ||
Whether to support math (text) with a single dollar (`boolean`, default: | ||
`true`). | ||
Single dollars work in Pandoc and many other places, but often interfere with | ||
“normal” dollars in text. | ||
#### Notes | ||
@@ -93,0 +102,0 @@ |
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
11824
45
182
+ Added@types/katex@0.16.7(transitive)
+ Addeddequal@2.0.3(transitive)
+ Addeddiff@5.2.0(transitive)
+ Addedkatex@0.16.11(transitive)
+ Addedkleur@4.1.5(transitive)
+ Addedmdast-util-math@2.0.2(transitive)
+ Addedmicromark-extension-math@2.1.2(transitive)
+ Addedmri@1.2.0(transitive)
+ Addedsade@1.8.1(transitive)
+ Addeduvu@0.5.6(transitive)
- Removed@types/katex@0.11.1(transitive)
- Removedkatex@0.13.24(transitive)
- Removedmdast-util-math@1.1.0(transitive)
- Removedmicromark-extension-math@1.0.0(transitive)
Updatedmdast-util-math@^2.0.0