bajo-template 2.11.0 → 2.12.0
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/index.js +15 -0
- package/package.json +3 -2
- package/wiki/CHANGES.md +4 -0
package/index.js
CHANGED
|
@@ -593,6 +593,21 @@ async function factory (pkgName) {
|
|
|
593
593
|
content = content ?? ''
|
|
594
594
|
return { frontMatter, content }
|
|
595
595
|
}
|
|
596
|
+
|
|
597
|
+
formatContent = (content, options = {}) => {
|
|
598
|
+
const { smallHeading = false } = options
|
|
599
|
+
const { parse } = this.app.bajoMarkdown
|
|
600
|
+
const parts = content.split('\n\n')
|
|
601
|
+
content = parse(`<p>${parts.join('</p><p>')}</p>`)
|
|
602
|
+
const mapper = ['5:6', '4:6', '3:5', '2:4', '1:3']
|
|
603
|
+
if (smallHeading) {
|
|
604
|
+
for (const m of mapper) {
|
|
605
|
+
const [from, to] = m.split(':')
|
|
606
|
+
content = content.replaceAll(`<h${from}>`, `<h${to}>`).replaceAll(`</h${from}>`, `</h${to}>`)
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return content
|
|
610
|
+
}
|
|
596
611
|
}
|
|
597
612
|
|
|
598
613
|
return BajoTemplate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bajo-template",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Template Renderer for Bajo Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"bajo": {
|
|
12
12
|
"type": "plugin",
|
|
13
|
-
"alias": "tpl"
|
|
13
|
+
"alias": "tpl",
|
|
14
|
+
"dependencies": ["bajo-markdown"]
|
|
14
15
|
},
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|