@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 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
- if (line.next != 61 /* '=' */)
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
- if (line.next != 61 /* '=' */)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farvardin/lezer-parser-markdown",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Incremental Markdown parser that consumes and emits Lezer trees (txt2tags version)",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",
package/src/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  <!-- /README.md is generated from /src/README.md -->
2
2
 
3
- # @lezer/markdown
3
+ # @farvardin/lezer-parser-markdown
4
4
 
5
- This is an incremental Markdown ([CommonMark](https://commonmark.org/)
6
- with support for extension) parser that integrates well with the
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
- if (line.next != 61 /* '=' */) return -1
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