Skip to content

Commit

Permalink
fix: no markdown support for underline requarks#2072
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Jun 17, 2020
1 parent 3b055f2 commit 5d263d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/components/editor/editor-markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ import 'codemirror/addon/hint/show-hint.js'
// Markdown-it
import MarkdownIt from 'markdown-it'
import mdAttrs from 'markdown-it-attrs'
import underline from 'markdown-it-plugin-underline'
import mdEmoji from 'markdown-it-emoji'
import mdTaskLists from 'markdown-it-task-lists'
import mdExpandTabs from 'markdown-it-expand-tabs'
Expand Down Expand Up @@ -268,6 +269,7 @@ const md = new MarkdownIt({
.use(mdAttrs, {
allowedAttributes: ['id', 'class', 'target']
})
.use(underline)
.use(mdEmoji)
.use(mdTaskLists, {label: true, labelAfter: true})
.use(mdExpandTabs)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"markdown-it-imsize": "2.0.1",
"markdown-it-mark": "3.0.0",
"markdown-it-mathjax": "2.0.0",
"markdown-it-plugin-underline": "0.0.1",
"markdown-it-sub": "1.0.0",
"markdown-it-sup": "1.0.0",
"markdown-it-task-lists": "2.1.1",
Expand Down
3 changes: 3 additions & 0 deletions server/modules/rendering/markdown-core/renderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const md = require('markdown-it')
const mdAttrs = require('markdown-it-attrs')
const _ = require('lodash')
const underline = require('markdown-it-plugin-underline')

const quoteStyles = {
Chinese: '””‘’',
Expand Down Expand Up @@ -30,6 +31,8 @@ module.exports = {
}
})

mkdown.use(underline)

mkdown.use(mdAttrs, {
allowedAttributes: ['id', 'class', 'target']
})
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11393,6 +11393,11 @@ markdown-it-mathjax@2.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-mathjax/-/markdown-it-mathjax-2.0.0.tgz#ae2b4f4c5c719a03f9e475c664f7b2685231d9e9"
integrity sha1-ritPTFxxmgP55HXGZPeyaFIx2ek=

markdown-it-plugin-underline@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/markdown-it-plugin-underline/-/markdown-it-plugin-underline-0.0.1.tgz#02af7fff0c54286f2d954ee2742c283261a3a1ef"
integrity sha512-DtmxlE70JpNSacXU62kLa7degjVft4GU9QkR8cL0LYZLK7k6xgibpoUMsNdvtDG8QSUGOl1955AFtDJC7d9t6g==

markdown-it-sub@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8"
Expand Down

0 comments on commit 5d263d8

Please sign in to comment.