bajo-markdown 1.0.2 → 1.0.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/bajo/start.js CHANGED
@@ -17,6 +17,7 @@ async function start () {
17
17
  if (this.app.waibuExtra) {
18
18
  const hljs = await importPkg('waibuExtra:highlight.js')
19
19
  const highlight = markedHighlight({
20
+ emptyLangClass: 'hljs',
20
21
  langPrefix: 'hljs language-',
21
22
  highlight (code, lang) {
22
23
  const language = hljs.getLanguage(lang) ? lang : 'plaintext'
@@ -27,11 +28,6 @@ async function start () {
27
28
  }
28
29
  const marked = new Marked(options)
29
30
  marked.use({ renderer, extensions: [emoji] })
30
- marked.Renderer.prototype.paragraph = (text) => {
31
- if (text.startsWith('<c:')) return text + '\n' // for weibu component
32
- return '<p>' + text + '</p>'
33
- }
34
-
35
31
  this.instance = marked
36
32
  }
37
33
 
package/lib/renderer.js CHANGED
@@ -1,6 +1,10 @@
1
1
  async function renderer () {
2
2
  const config = this.config
3
3
  return {
4
+ paragraph ({ text, tokens }) {
5
+ if (text.startsWith('<c:')) return text + '\n' // for weibu component
6
+ return '<p>' + this.parser.parseInline(tokens) + '</p>'
7
+ },
4
8
  table (header, body) {
5
9
  return `
6
10
  <table class="${config.renderer.tableClass}">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-markdown",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Markdown support for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {