@lezer/markdown
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -0,1 +1,11 @@ | ||
## 1.2.0 (2023-12-25) | ||
### Bug fixes | ||
Properly require whitespace before link titles. Parse autolinks as their own nodes | ||
### New features | ||
Wrap autolinks in an `Autolink` syntax node, rather than just `URL`, and exclude the wrapping angle brackets from the `URL` nodes. | ||
## 1.1.2 (2023-12-07) | ||
@@ -2,0 +12,0 @@ |
@@ -36,3 +36,3 @@ import { Tree, NodeType, NodePropSource, TreeFragment, NodeSet, Input, Parser, PartialParse, ParseWrapper } from "@lezer/common"; | ||
ProcessingInstruction = 32, | ||
URL = 33, | ||
Autolink = 33, | ||
HeaderMark = 34, | ||
@@ -47,3 +47,4 @@ QuoteMark = 35, | ||
LinkTitle = 42, | ||
LinkLabel = 43 | ||
LinkLabel = 43, | ||
URL = 44 | ||
} | ||
@@ -50,0 +51,0 @@ export declare class LeafBlock { |
{ | ||
"name": "@lezer/markdown", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Incremental Markdown parser that consumes and emits Lezer trees", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
@@ -32,2 +32,3 @@ import {Tree} from "@lezer/common" | ||
Ln: "Link", | ||
Al: "Autolink", | ||
Im: "Image", | ||
@@ -34,0 +35,0 @@ C: "InlineCode", |
@@ -1956,3 +1956,3 @@ import {parser} from "../dist/index.js" | ||
test("Backslash escapes (example 306)", ` | ||
{P:{URL:<http://example.com?find=\\*>}} | ||
{P:{Al:{L:<}{URL:http://example.com?find=\\*}{L:>}}} | ||
`) | ||
@@ -2147,3 +2147,3 @@ | ||
test("Code spans (example 346)", ` | ||
{P:{URL:<http://foo.bar.\`baz>}\`} | ||
{P:{Al:{L:<}{URL:http://foo.bar.\`baz}{L:>}}\`} | ||
`) | ||
@@ -2686,7 +2686,7 @@ | ||
test("Emphasis and strong emphasis (example 479)", ` | ||
{P:**a{URL:<http://foo.bar/?q=**>}} | ||
{P:**a{Al:{L:<}{URL:http://foo.bar/?q=**}{L:>}}} | ||
`) | ||
test("Emphasis and strong emphasis (example 480)", ` | ||
{P:__a{URL:<http://foo.bar/?q=__>}} | ||
{P:__a{Al:{L:<}{URL:http://foo.bar/?q=__}{L:>}}} | ||
`) | ||
@@ -2876,3 +2876,3 @@ | ||
test("Links (example 522)", ` | ||
{P:[foo{URL:<http://example.com/?search=](uri)>}} | ||
{P:[foo{Al:{L:<}{URL:http://example.com/?search=](uri)}{L:>}}} | ||
`) | ||
@@ -2949,3 +2949,3 @@ | ||
test("Links (example 534)", ` | ||
{P:[foo{URL:<http://example.com/?search=][ref]>}} | ||
{P:[foo{Al:{L:<}{URL:http://example.com/?search=][ref]}{L:>}}} | ||
@@ -3285,31 +3285,31 @@ {LR:{LL:[ref]}{L::} {URL:/uri}} | ||
test("Autolinks (example 590)", ` | ||
{P:{URL:<http://foo.bar.baz>}} | ||
{P:{Al:{L:<}{URL:http://foo.bar.baz}{L:>}}} | ||
`) | ||
test("Autolinks (example 591)", ` | ||
{P:{URL:<http://foo.bar.baz/test?q=hello&id=22&boolean>}} | ||
{P:{Al:{L:<}{URL:http://foo.bar.baz/test?q=hello&id=22&boolean}{L:>}}} | ||
`) | ||
test("Autolinks (example 592)", ` | ||
{P:{URL:<irc://foo.bar:2233/baz>}} | ||
{P:{Al:{L:<}{URL:irc://foo.bar:2233/baz}{L:>}}} | ||
`) | ||
test("Autolinks (example 593)", ` | ||
{P:{URL:<MAILTO:FOO@BAR.BAZ>}} | ||
{P:{Al:{L:<}{URL:MAILTO:FOO@BAR.BAZ}{L:>}}} | ||
`) | ||
test("Autolinks (example 594)", ` | ||
{P:{URL:<a+b+c:d>}} | ||
{P:{Al:{L:<}{URL:a+b+c:d}{L:>}}} | ||
`) | ||
test("Autolinks (example 595)", ` | ||
{P:{URL:<made-up-scheme://foo,bar>}} | ||
{P:{Al:{L:<}{URL:made-up-scheme://foo,bar}{L:>}}} | ||
`) | ||
test("Autolinks (example 596)", ` | ||
{P:{URL:<http://../>}} | ||
{P:{Al:{L:<}{URL:http://../}{L:>}}} | ||
`) | ||
test("Autolinks (example 597)", ` | ||
{P:{URL:<localhost:5001/foo>}} | ||
{P:{Al:{L:<}{URL:localhost:5001/foo}{L:>}}} | ||
`) | ||
@@ -3322,11 +3322,11 @@ | ||
test("Autolinks (example 599)", ` | ||
{P:{URL:<http://example.com/\\[\\>}} | ||
{P:{Al:{L:<}{URL:http://example.com/\\[\\}{L:>}}} | ||
`) | ||
test("Autolinks (example 600)", ` | ||
{P:{URL:<foo@bar.example.com>}} | ||
{P:{Al:{L:<}{URL:foo@bar.example.com}{L:>}}} | ||
`) | ||
test("Autolinks (example 601)", ` | ||
{P:{URL:<foo+special@Bar.baz-bar0.com>}} | ||
{P:{Al:{L:<}{URL:foo+special@Bar.baz-bar0.com}{L:>}}} | ||
`) | ||
@@ -3333,0 +3333,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
404718
9770