pantsdown 2.1.1 → 2.1.3

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "pantsdown",
3
3
  "author": "wallpants",
4
4
  "type": "module",
5
- "version": "2.1.1",
5
+ "version": "2.1.3",
6
6
  "license": "MIT",
7
7
  "description": "Markdown to 'GitHub HTML' parser",
8
8
  "repository": {
@@ -54,18 +54,18 @@
54
54
  "highlight.js": "^11.9.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@commitlint/config-conventional": "^19.1.0",
57
+ "@commitlint/config-conventional": "^19.2.2",
58
58
  "@commitlint/cz-commitlint": "^19.2.0",
59
- "@happy-dom/global-registrator": "^14.0.0",
60
- "@types/bun": "^1.0.12",
61
- "@typescript-eslint/eslint-plugin": "^7.5.0",
62
- "@typescript-eslint/parser": "^7.5.0",
59
+ "@happy-dom/global-registrator": "^14.10.1",
60
+ "@types/bun": "^1.1.1",
61
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
62
+ "@typescript-eslint/parser": "^7.8.0",
63
63
  "commitizen": "^4.3.0",
64
- "commitlint": "^19.2.1",
64
+ "commitlint": "^19.3.0",
65
65
  "eslint": "^8.57.0",
66
66
  "prettier": "^3.2.5",
67
67
  "prettier-plugin-organize-imports": "^3.2.4",
68
- "semantic-release": "^23.0.6",
69
- "typescript": "5.4.2"
68
+ "semantic-release": "^23.1.1",
69
+ "typescript": "5.4.5"
70
70
  }
71
71
  }
@@ -106,7 +106,7 @@ const block_paragraph = edit(
106
106
  )
107
107
  .replace("hr", block_hr)
108
108
  .replace("heading", " {0,3}#{1,6}(?:\\s|$)")
109
- .replace("|lheading", "") // setex headings don't interrupt commonmark paragraphs
109
+ .replace("|lheading", "") // setext headings don't interrupt commonmark paragraphs
110
110
  .replace("table", block_table) // interrupt paragraphs with table
111
111
  .replace("blockquote", " {0,3}>")
112
112
  .replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n")
package/src/tokenizer.ts CHANGED
@@ -105,7 +105,9 @@ export class Tokenizer {
105
105
  const cap = block.blockquote.exec(src);
106
106
  if (!cap) return undefined;
107
107
 
108
- let text = rtrim(cap[0].replace(/^ *>[ \t]?/gm, ""), "\n");
108
+ // precede setext continuation with 4 spaces so it isn't a setext
109
+ let text = cap[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n $1");
110
+ text = rtrim(text.replace(/^ *>[ \t]?/gm, ""), "\n");
109
111
  const top = this.lexer.state.top;
110
112
  this.lexer.state.top = true;
111
113
  const tokens = this.lexer.blockTokens(text, []);