pantsdown 2.0.5 → 2.0.7
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/.prettierignore +1 -0
- package/package.json +27 -15
- package/src/parser.ts +5 -5
- package/src/tokenizer.ts +1 -1
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.github/dependabot.yml
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantsdown",
|
|
3
|
-
"version": "2.0.5",
|
|
4
3
|
"author": "wallpants",
|
|
5
|
-
"description": "Markdown to 'GitHub HTML' parser",
|
|
6
|
-
"license": "MIT",
|
|
7
4
|
"type": "module",
|
|
5
|
+
"version": "2.0.7",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"description": "Markdown to 'GitHub HTML' parser",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git://github.com/wallpants/pantsdown.git"
|
|
@@ -21,19 +21,29 @@
|
|
|
21
21
|
"import": "./src/index.ts"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"config": {
|
|
25
|
-
"commitizen": {
|
|
26
|
-
"path": "cz-conventional-changelog"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
24
|
"release": {
|
|
30
25
|
"branches": [
|
|
31
26
|
"main"
|
|
32
27
|
]
|
|
33
28
|
},
|
|
29
|
+
"config": {
|
|
30
|
+
"commitizen": {
|
|
31
|
+
"path": "@commitlint/cz-commitlint"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"commitlint": {
|
|
35
|
+
"extends": [
|
|
36
|
+
"@commitlint/config-conventional"
|
|
37
|
+
],
|
|
38
|
+
"rules": {
|
|
39
|
+
"body-max-line-length": [
|
|
40
|
+
0
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
34
44
|
"scripts": {
|
|
35
45
|
"commit": "cz",
|
|
36
|
-
"format": "prettier **/*.{md,ts,css} -w",
|
|
46
|
+
"format": "prettier **/*.{md,ts,css,yml} -w",
|
|
37
47
|
"lint": "tsc && eslint . --ext ts --report-unused-disable-directives --max-warnings 0",
|
|
38
48
|
"docs:build": "bun run docs/build.ts"
|
|
39
49
|
},
|
|
@@ -42,16 +52,18 @@
|
|
|
42
52
|
"highlight.js": "^11.9.0"
|
|
43
53
|
},
|
|
44
54
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
55
|
+
"@commitlint/config-conventional": "^18.6.2",
|
|
56
|
+
"@commitlint/cz-commitlint": "^18.6.1",
|
|
57
|
+
"@happy-dom/global-registrator": "^13.3.8",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
59
|
+
"@typescript-eslint/parser": "^7.0.2",
|
|
48
60
|
"bun-types": "latest",
|
|
49
61
|
"commitizen": "^4.3.0",
|
|
50
|
-
"
|
|
62
|
+
"commitlint": "^18.6.1",
|
|
51
63
|
"eslint": "^8.56.0",
|
|
52
|
-
"prettier": "^3.
|
|
64
|
+
"prettier": "^3.2.5",
|
|
53
65
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
54
|
-
"semantic-release": "^
|
|
66
|
+
"semantic-release": "^23.0.2",
|
|
55
67
|
"typescript": "5.3.3"
|
|
56
68
|
}
|
|
57
69
|
}
|
package/src/parser.ts
CHANGED
|
@@ -109,13 +109,13 @@ export class Parser {
|
|
|
109
109
|
item.tokens.length > 0 &&
|
|
110
110
|
item.tokens[0]!.type === "paragraph"
|
|
111
111
|
) {
|
|
112
|
-
item.tokens[0]
|
|
112
|
+
item.tokens[0].text = checkbox + " " + item.tokens[0].text;
|
|
113
113
|
if (
|
|
114
|
-
item.tokens[0]
|
|
115
|
-
item.tokens[0]
|
|
114
|
+
item.tokens[0].tokens.length > 0 &&
|
|
115
|
+
item.tokens[0].tokens[0]!.type === "text"
|
|
116
116
|
) {
|
|
117
|
-
item.tokens[0]
|
|
118
|
-
checkbox + " " + item.tokens[0]
|
|
117
|
+
item.tokens[0].tokens[0]!.text =
|
|
118
|
+
checkbox + " " + item.tokens[0].tokens[0]!.text;
|
|
119
119
|
}
|
|
120
120
|
} else {
|
|
121
121
|
item.tokens.unshift({
|
package/src/tokenizer.ts
CHANGED
|
@@ -757,7 +757,7 @@ export class Tokenizer {
|
|
|
757
757
|
// Remove extra characters. *a*** -> *a*
|
|
758
758
|
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
|
|
759
759
|
// char length can be >1 for unicode characters;
|
|
760
|
-
const lastCharLength = [...match[0]]
|
|
760
|
+
const lastCharLength = [...match[0]][0]!.length;
|
|
761
761
|
const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
|
|
762
762
|
|
|
763
763
|
// Create `em` if smallest delimiter has odd char count. *a***
|