@markii/core 0.17.0-next.3 → 0.17.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/to-hast.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# @markii/core
|
|
2
2
|
|
|
3
|
-
The framework-agnostic reference parser for [Markii](https://github.com/markii-org/markii) (`.mk.md`): CommonMark + GitHub-Flavored Markdown plus a generic directive syntax, parsed to an mdast tree and converted to a sanitized hast tree. Zero React dependency
|
|
3
|
+
The framework-agnostic reference parser for [Markii](https://github.com/markii-org/markii) (`.mk.md`): CommonMark + GitHub-Flavored Markdown plus a generic directive syntax, parsed to an mdast tree and converted to a sanitized hast tree. Zero React dependency, component-agnostic by design, so any renderer (e.g. `@markii/react`) can consume its output.
|
|
4
4
|
|
|
5
5
|
See the [repository](https://github.com/markii-org/markii) for the format spec and the reference library as a whole.
|
package/dist/to-hast.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { unified } from 'unified';
|
|
2
|
+
import { parse } from './parse.js';
|
|
2
3
|
import remarkParse from 'remark-parse';
|
|
3
4
|
import remarkDirective from 'remark-directive';
|
|
4
5
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
@@ -195,7 +196,9 @@ function createProcessor() {
|
|
|
195
196
|
*/
|
|
196
197
|
export function toHast(text) {
|
|
197
198
|
const processor = createProcessor();
|
|
198
|
-
|
|
199
|
+
// The shared `parse` (not `processor.parse`) so the word-start demotion
|
|
200
|
+
// of a colon in prose applies here exactly as it does for an AST consumer.
|
|
201
|
+
const mdastTree = parse(text);
|
|
199
202
|
const hastTree = processor.runSync(mdastTree);
|
|
200
203
|
sanitizeUrls(hastTree);
|
|
201
204
|
return hastTree;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markii/core",
|
|
3
|
-
"version": "0.17.0-next.
|
|
3
|
+
"version": "0.17.0-next.4",
|
|
4
4
|
"description": "Framework-agnostic reference parser for Mark (.mk.md): CommonMark + directives to mdast, and mdast to a sanitized hast tree. Zero React dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|