@md-plugins/md-plugin-headers 0.1.0-alpha.22 → 0.1.0-alpha.24
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.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ const andRE = /&/g;
|
|
|
2
2
|
const rCombining = /[\u0300-\u036F]/g;
|
|
3
3
|
const rControl = /[\u0000-\u001f]/g;
|
|
4
4
|
const rSpecial = /[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g;
|
|
5
|
-
const slugify = (str) => str.
|
|
5
|
+
const slugify = (str) => str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase().normalize("NFKD").replace(rCombining, "").replace(andRE, "-and-").replace(rControl, "-").replace(rSpecial, "-").replace(/[^a-z0-9-]+/g, "").replace(/([a-z])(\d)/g, "$1-$2").replace(/(\d)([a-z])/g, "$1-$2").replace(/-{2,}/g, "-").replace(/(^-|-$)/g, "").replace(/^(\d)/, "_$1");
|
|
6
6
|
|
|
7
7
|
const titleRE = /<\/?[^>]+(>|$)/g;
|
|
8
8
|
const apiRE = /^<MarkdownApi /;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/md-plugin-headers",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.24",
|
|
4
4
|
"description": "A markdown-it plugin for handling headers (H1-H6).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"markdown-it": "^14.1.0",
|
|
37
37
|
"@types/markdown-it": "^14.1.2",
|
|
38
|
-
"@md-plugins/shared": "0.1.0-alpha.
|
|
38
|
+
"@md-plugins/shared": "0.1.0-alpha.24"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"markdown-it": "^14.1.0"
|