Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a3c5077
Replace front matter plugin with just calling parseFrontMatter first
j-f1 Oct 18, 2022
660bab4
Bump remark
j-f1 Oct 18, 2022
c2e0b48
Rewrite liquid plugin
j-f1 Oct 18, 2022
bca0429
Update format-test.js
j-f1 Oct 18, 2022
2605764
Rewrite wikiLink
j-f1 Oct 18, 2022
2c82682
Allow newlines in liquid*
j-f1 Oct 18, 2022
d44c5f5
Use node.raw instead of originalText when printing front-matter
j-f1 Oct 18, 2022
7dc0d44
Don’t throw in wikiLink (not sure why)
j-f1 Oct 18, 2022
73f6a22
Fix multiline liquid expressions
j-f1 Oct 18, 2022
506e4d0
Fix wiki link parsing
j-f1 Oct 18, 2022
ab1f05d
Differentiate between inline/block liquid
j-f1 Oct 18, 2022
f8c4ddb
Fix build script
fisker Oct 20, 2022
a6c7404
Fix build script
fisker Oct 20, 2022
87d1cd5
+ remark-gfm
j-f1 Oct 19, 2022
53bb714
Remove GFM autolink support + duplicate footnotes extension
j-f1 Oct 19, 2022
49f2285
Enable development condition in tests
j-f1 Oct 20, 2022
76e5701
Remove unsued vars
j-f1 Oct 26, 2022
2ac3841
Remove flow wiki link construct
j-f1 Oct 28, 2022
22e8011
update snapshots
j-f1 Oct 18, 2022
c070d82
Update snapshot
fisker Dec 15, 2022
7d4dc4c
Bring old `mdx` parser back
fisker Feb 16, 2023
68d16b0
Fix
fisker Feb 16, 2023
93479bf
Fix snapshots
fisker Feb 16, 2023
eea6276
Markdown: Remove loos-item plugin
fisker Feb 16, 2023
bcfe843
Use `charAt` insteadOf `slice`
fisker Feb 16, 2023
7e0b37d
Fix html
fisker Feb 16, 2023
35628ac
fix
fisker Feb 16, 2023
01aa8aa
Revert "Fix html"
fisker Feb 16, 2023
936ea90
Bad merge
fisker Feb 17, 2023
95967b3
upgrade unified
fisker Feb 17, 2023
396174a
Fix html
fisker Feb 16, 2023
75e1259
Fix blockquote
fisker Feb 17, 2023
d70e308
Fix loose item check
fisker Feb 17, 2023
6f354cb
Fix `imageReference`
fisker Feb 17, 2023
11c3ad2
Fix `imageReference` (2)
fisker Feb 17, 2023
8488f8d
Fix `wikiLink`
fisker Feb 17, 2023
6eae2c5
`word` print
fisker Feb 17, 2023
200410a
Fix `math`
fisker Feb 17, 2023
2ae8752
Fix Loose item check?
fisker Feb 17, 2023
19a260a
Fix FencedCode with no end mark
fisker Feb 17, 2023
4d1b5bc
Remove getFencedCodeBlockValue
fisker Feb 17, 2023
8135c21
Remove outdated comment
fisker Feb 17, 2023
2684af5
Restore title test
fisker Feb 17, 2023
39e04a4
Fix title
fisker Feb 17, 2023
b645378
Merge branch 'main' into upgrade-remark
fisker Aug 16, 2023
658b7cf
Fix
fisker Aug 16, 2023
319e505
Merge branch 'main' into upgrade-remark
fisker Jun 22, 2024
9f9cfb8
Update deps
fisker Jun 22, 2024
327cd49
Make it runnable
fisker Jun 22, 2024
ffdbcc3
Update snapshots
fisker Jun 22, 2024
9989799
remark-gfm
fisker Jun 22, 2024
a9dbc4e
Use liquid from #16134
fisker Jun 22, 2024
037eb90
`remark-wiki-link`
fisker Jun 22, 2024
b08587a
Fix
fisker Jun 22, 2024
9be020d
Fix?
fisker Jun 22, 2024
aca5b91
Revert `isLooseListItem`
fisker Jun 22, 2024
5790aa3
Restore `shouldPrePrintDoubleHardline`
fisker Jun 22, 2024
c767d3c
Wiki link
fisker Jun 22, 2024
f4660ca
Add `.hg` back
fisker Jun 22, 2024
e4ec5d6
Use `remark-gfm`
fisker Jun 22, 2024
cc26e33
Restore print logic
fisker Jun 22, 2024
f0351db
Fix
fisker Jun 22, 2024
ae375c3
Reduce diff
fisker Jun 22, 2024
ac15218
CLEAN!
fisker Jun 22, 2024
65c9be8
Bring back old stuff
fisker Jun 22, 2024
cde236b
Minor refactor
fisker Jun 22, 2024
c2ec2de
Linting
fisker Jun 22, 2024
e67f41b
Spellcheck
fisker Jun 22, 2024
4f06493
yarn dedupe
fisker Jun 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CLEAN!
  • Loading branch information
fisker committed Jun 22, 2024
commit ac152186e64f978855ac60da52c3c10214f5411d
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,7 @@
"leven": "4.0.0",
"lines-and-columns": "2.0.4",
"linguist-languages": "7.27.0",
"mdast-util-gfm-footnote": "2.0.0",
"mdast-util-gfm-strikethrough": "2.0.0",
"mdast-util-gfm-table": "2.0.0",
"mdast-util-gfm-task-list-item": "2.0.0",
"meriyah": "4.5.0",
"micromark-extension-gfm-footnote": "2.0.0",
"micromark-extension-gfm-strikethrough": "2.0.0",
"micromark-extension-gfm-table": "2.0.0",
"micromark-extension-gfm-task-list-item": "2.0.1",
"micromark-util-character": "2.1.0",
"micromark-util-symbol": "2.0.0",
"micromatch": "4.0.7",
Expand Down
10 changes: 5 additions & 5 deletions src/language-markdown/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ function clean(original, cloned, parent) {
}

// if (
// (ast.type === "definition" ||
// ast.type === "link" ||
// ast.type === "image") &&
// ast.title
// (original.type === "definition" ||
// original.type === "link" ||
// original.type === "image") &&
// original.title
// ) {
// newObj.title = ast.title.replaceAll(/\\(?=["')])/g, "");
// cloned.title = original.title.replaceAll(/\\(?=["')])/gu, "");
// }

if (
Expand Down
2 changes: 1 addition & 1 deletion src/language-markdown/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as parsersMarkdown from "./parser-markdown.js";
import * as parsersMdx from "./parser-mdx.js";
import * as parsersMarkdown from "./parser-remark-11-markdown.js";
import printer from "./printer-markdown.js";

export const parsers = {
Expand Down
2 changes: 1 addition & 1 deletion src/language-markdown/mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ tokenizeEsSyntax.locator = (value /*, fromIndex*/) =>
tokenizeEsComment.locator = (value, fromIndex) => value.indexOf("{", fromIndex);

/**
* @type {import('unified').Plugin<[], import('unified').Settings>}
* @type {import('unified-v9').Plugin<[], import('unified-v9').Settings>}
*/
const esSyntax = function () {
const { Parser } = this;
Expand Down
14 changes: 8 additions & 6 deletions src/language-markdown/parser-mdx.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import footnotes from "remark-footnotes";
import remarkMath from "remark-math-v3";
import remarkParse from "remark-parse-v8";
import unified from "unified-v9";
import remarkMath from "remark-math-v3";
import footnotes from "remark-footnotes";
import { hasPragma } from "./pragma.js";
import { locStart, locEnd } from "./loc.js";

import { locEnd, locStart } from "./loc.js";
import { BLOCKS_REGEX, esSyntax } from "./mdx.js";
import htmlToJsx from "./unified-plugins/html-to-jsx.js";
import { hasPragma } from "./pragma.js";
import frontMatter from "./unified-plugins/front-matter.js";
import htmlToJsx from "./unified-plugins/html-to-jsx.js";
import liquid from "./unified-plugins/liquid.js";
import wikiLink from "./unified-plugins/wiki-link.js";

Expand Down Expand Up @@ -36,8 +37,10 @@ const mdxParser = {
commonmark: true,
blocks: [BLOCKS_REGEX],
})
// @ts-expect-error -- IDK
.use(footnotes)
.use(frontMatter)
// @ts-expect-error -- IDK
.use(remarkMath)
.use(esSyntax)
.use(liquid)
Expand All @@ -47,5 +50,4 @@ const mdxParser = {
},
};


export const mdx = mdxParser;
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import footnotes from "remark-footnotes";
import gfm from "remark-gfm";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import remarkParse from "remark-parse";
import remarkWikiLink from "remark-wiki-link";
import { unified } from "unified";

import parseFrontMatter from "../utils/front-matter/parse.js";
import { locEnd, locStart } from "./loc.js";
import { BLOCKS_REGEX, esSyntax } from "./mdx.js";
import { hasPragma } from "./pragma.js";
import frontMatter from "./unified-plugins/front-matter.js";
import htmlToJsx from "./unified-plugins/html-to-jsx.js";
import { remarkLiquid } from "./unified-plugins/liquid-for-micromark.js";
import wikiLink from "./unified-plugins/wiki-link-for-micromark.js";
import remarkLiquid from "./unified-plugins/remark-11-liquid.js";

/**
* based on [MDAST](https://github.com/syntax-tree/mdast) with following modifications:
Expand All @@ -32,18 +27,16 @@ function createParse() {
const processor = unified()
.use(remarkParse)
.use(remarkMath)
.use(gfm)
.use(remarkGfm)
.use(remarkLiquid)
.use(remarkWikiLink);

return async (text, options) => {
return async (text) => {
const { frontMatter, content } = parseFrontMatter(text);
const ast = await processor.run(processor.parse(content));
{
// console.log(JSON.stringify(ast.children, 0, 2));
}

if (frontMatter) {
// @ts-expect-error -- Missing?
ast.children.unshift(frontMatter);
}

Expand Down
2 changes: 1 addition & 1 deletion src/language-markdown/unified-plugins/front-matter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import parseFrontMatter from "../../utils/front-matter/parse.js";

/**
* @type {import('unified').Plugin<[], import('unified').Settings>}
* @type {import('unified-v9').Plugin<[], import('unified-v9').Settings>}
*/
const frontMatter = function () {
const proto = this.Parser.prototype;
Expand Down
23 changes: 0 additions & 23 deletions src/language-markdown/unified-plugins/gfm.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/language-markdown/unified-plugins/liquid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @type {import('unified').Plugin<[], import('unified').Settings>}
* @type {import('unified-v9').Plugin<[], import('unified-v9').Settings>}
*/
const liquid = function () {
const proto = this.Parser.prototype;
Expand Down
7 changes: 0 additions & 7 deletions src/language-markdown/unified-plugins/markdown-plugin.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/language-markdown/unified-plugins/mdast-extensions.d.ts

This file was deleted.

65 changes: 0 additions & 65 deletions src/language-markdown/unified-plugins/micromark-extension-gfm.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ function syntax() {
}
}

export { remarkLiquid };
export default remarkLiquid;
48 changes: 0 additions & 48 deletions src/language-markdown/unified-plugins/remark-gfm.js

This file was deleted.

Loading