@farvardin/lezer-parser-markdown 1.6.3 → 1.6.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/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/README.md +4 -3
- package/src/markdown.ts +3 -2
package/dist/index.cjs
CHANGED
|
@@ -347,10 +347,11 @@ function isOrderedList(line, cx, breaking) {
|
|
|
347
347
|
return pos + 1 - line.pos;
|
|
348
348
|
}
|
|
349
349
|
function isAtxHeading(line) {
|
|
350
|
-
|
|
350
|
+
// /* '=' || '#' */
|
|
351
|
+
if (line.next != 61 || line.next != 35)
|
|
351
352
|
return -1;
|
|
352
353
|
let pos = line.pos + 1;
|
|
353
|
-
while (pos < line.text.length && line.text.charCodeAt(pos) == 61)
|
|
354
|
+
while (pos < line.text.length && line.text.charCodeAt(pos) == 61 || pos < line.text.length && line.text.charCodeAt(pos) == 35)
|
|
354
355
|
pos++;
|
|
355
356
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32)
|
|
356
357
|
return -1;
|
package/dist/index.js
CHANGED
|
@@ -345,10 +345,11 @@ function isOrderedList(line, cx, breaking) {
|
|
|
345
345
|
return pos + 1 - line.pos;
|
|
346
346
|
}
|
|
347
347
|
function isAtxHeading(line) {
|
|
348
|
-
|
|
348
|
+
// /* '=' || '#' */
|
|
349
|
+
if (line.next != 61 || line.next != 35)
|
|
349
350
|
return -1;
|
|
350
351
|
let pos = line.pos + 1;
|
|
351
|
-
while (pos < line.text.length && line.text.charCodeAt(pos) == 61)
|
|
352
|
+
while (pos < line.text.length && line.text.charCodeAt(pos) == 61 || pos < line.text.length && line.text.charCodeAt(pos) == 35)
|
|
352
353
|
pos++;
|
|
353
354
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32)
|
|
354
355
|
return -1;
|
package/package.json
CHANGED
package/src/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<!-- /README.md is generated from /src/README.md -->
|
|
2
2
|
|
|
3
|
-
# @lezer
|
|
3
|
+
# @farvardin/lezer-parser-markdown
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
fork of https://www.npmjs.com/package/@lezer/markdown
|
|
6
|
+
|
|
7
|
+
This is an incremental ~~markdown~~ txt2tags parser that integrates well with the
|
|
7
8
|
[Lezer](https://lezer.codemirror.net/) parser system. It does not in
|
|
8
9
|
fact use the Lezer runtime (that runs LR parsers, and Markdown can't
|
|
9
10
|
really be parsed that way), but it produces Lezer-style compact syntax
|
package/src/markdown.ts
CHANGED
|
@@ -299,9 +299,10 @@ function isOrderedList(line: Line, cx: BlockContext, breaking: boolean) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
function isAtxHeading(line: Line) {
|
|
302
|
-
|
|
302
|
+
// /* '=' || '#' */
|
|
303
|
+
if (line.next != 61 || line.next != 35) return -1
|
|
303
304
|
let pos = line.pos + 1
|
|
304
|
-
while (pos < line.text.length && line.text.charCodeAt(pos) == 61) pos++
|
|
305
|
+
while (pos < line.text.length && line.text.charCodeAt(pos) == 61 || pos < line.text.length && line.text.charCodeAt(pos) == 35) pos++
|
|
305
306
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32) return -1
|
|
306
307
|
let size = pos - line.pos
|
|
307
308
|
return size > 6 ? -1 : size
|