Inline math support for remark
npm install @bizen241/remark-inline-mathremark-inline-math
=================

This is a remark plugin to support inline math surrounded by dollar signs.
> ### :warning: It's highly recommended to use remark-math instead of this package.
``js
const unified = require('unified');
const parse = require('remark-parse');
const remarkInlineMath = require('@bizen241/remark-inline-math');
const doc = '$1\\$ = 1$';
const ast = unified()
.use(parse)
.use(remarkInlineMath)
.parse(doc);
`
Yields:
`json`
{
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "inlineCode",
"value": "1\\$ = 1",
"data": {
"lang": "math"
}
}
]
}
]
}
or
`html`1\$ = 1
#### options
+ builder (Function)@param {string} value
+ - math expression (e.g. 1 + 1 = 2)@returns {MdastNode}
+ - MDAST node
Example:
`js``
const options = {
builder: (value) => ({
type: 'inlineCode',
value,
data: {
hName: 'math',
},
}),
};
MIT © bizen241