@farvardin/lezer-parser-markdown 1.6.3 → 1.6.5
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 +9 -2
- package/dist/index.js +9 -2
- package/package.json +1 -1
- package/publish.sh +0 -0
- package/src/README.md +4 -3
- package/src/markdown.ts +13 -2
package/dist/index.cjs
CHANGED
|
@@ -346,12 +346,19 @@ function isOrderedList(line, cx, breaking) {
|
|
|
346
346
|
return -1;
|
|
347
347
|
return pos + 1 - line.pos;
|
|
348
348
|
}
|
|
349
|
+
// 35 #
|
|
350
|
+
// 61 =
|
|
349
351
|
function isAtxHeading(line) {
|
|
350
|
-
if (line.next != 61 /*
|
|
352
|
+
// if (line.next != 61 || line.next != 35 /* = or # */ ) return -1
|
|
353
|
+
if (line.next != 61 || line.next != 35 /* = or # */)
|
|
351
354
|
return -1;
|
|
352
355
|
let pos = line.pos + 1;
|
|
353
|
-
while (pos < line.text.length && line.text.charCodeAt(pos) == 61)
|
|
356
|
+
// while (pos < line.text.length && line.text.charCodeAt(pos) == 61 || pos < line.text.length && line.text.charCodeAt(pos) == 35) pos++
|
|
357
|
+
// while ((pos < line.text.length && line.text.charCodeAt(pos) == 61) || (pos < line.text.length && line.text.charCodeAt(pos) == 35)) pos++
|
|
358
|
+
while (pos < line.text.length &&
|
|
359
|
+
(line.text.charCodeAt(pos) === 61 || line.text.charCodeAt(pos) === 35)) {
|
|
354
360
|
pos++;
|
|
361
|
+
}
|
|
355
362
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32)
|
|
356
363
|
return -1;
|
|
357
364
|
let size = pos - line.pos;
|
package/dist/index.js
CHANGED
|
@@ -344,12 +344,19 @@ function isOrderedList(line, cx, breaking) {
|
|
|
344
344
|
return -1;
|
|
345
345
|
return pos + 1 - line.pos;
|
|
346
346
|
}
|
|
347
|
+
// 35 #
|
|
348
|
+
// 61 =
|
|
347
349
|
function isAtxHeading(line) {
|
|
348
|
-
if (line.next != 61 /*
|
|
350
|
+
// if (line.next != 61 || line.next != 35 /* = or # */ ) return -1
|
|
351
|
+
if (line.next != 61 || line.next != 35 /* = or # */)
|
|
349
352
|
return -1;
|
|
350
353
|
let pos = line.pos + 1;
|
|
351
|
-
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) pos++
|
|
355
|
+
// while ((pos < line.text.length && line.text.charCodeAt(pos) == 61) || (pos < line.text.length && line.text.charCodeAt(pos) == 35)) pos++
|
|
356
|
+
while (pos < line.text.length &&
|
|
357
|
+
(line.text.charCodeAt(pos) === 61 || line.text.charCodeAt(pos) === 35)) {
|
|
352
358
|
pos++;
|
|
359
|
+
}
|
|
353
360
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32)
|
|
354
361
|
return -1;
|
|
355
362
|
let size = pos - line.pos;
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
File without changes
|
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
|
@@ -298,10 +298,21 @@ function isOrderedList(line: Line, cx: BlockContext, breaking: boolean) {
|
|
|
298
298
|
return pos + 1 - line.pos
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// 35 #
|
|
302
|
+
// 61 =
|
|
303
|
+
|
|
301
304
|
function isAtxHeading(line: Line) {
|
|
302
|
-
if (line.next != 61 /*
|
|
305
|
+
// if (line.next != 61 || line.next != 35 /* = or # */ ) return -1
|
|
306
|
+
if (line.next != 61 || line.next != 35 /* = or # */ ) return -1
|
|
303
307
|
let pos = line.pos + 1
|
|
304
|
-
while (pos < line.text.length && line.text.charCodeAt(pos) == 61) pos++
|
|
308
|
+
// while (pos < line.text.length && line.text.charCodeAt(pos) == 61 || pos < line.text.length && line.text.charCodeAt(pos) == 35) pos++
|
|
309
|
+
// while ((pos < line.text.length && line.text.charCodeAt(pos) == 61) || (pos < line.text.length && line.text.charCodeAt(pos) == 35)) pos++
|
|
310
|
+
while (
|
|
311
|
+
pos < line.text.length &&
|
|
312
|
+
(line.text.charCodeAt(pos) === 61 || line.text.charCodeAt(pos) === 35)
|
|
313
|
+
) {
|
|
314
|
+
pos++;
|
|
315
|
+
}
|
|
305
316
|
if (pos < line.text.length && line.text.charCodeAt(pos) != 32) return -1
|
|
306
317
|
let size = pos - line.pos
|
|
307
318
|
return size > 6 ? -1 : size
|