mirror of https://github.com/status-im/codimd.git
Use defaultUseHardbreak config when render
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
parent
495b65e3b9
commit
fd155fa74d
|
@ -195,7 +195,7 @@ export function isValidURL (str) {
|
|||
export function parseMeta (md, edit, view, toc, tocAffix) {
|
||||
let lang = null
|
||||
let dir = null
|
||||
let breaks = true
|
||||
let breaks = window.defaultUseHardbreak
|
||||
if (md && md.meta) {
|
||||
const meta = md.meta
|
||||
lang = meta.lang
|
||||
|
@ -225,10 +225,10 @@ export function parseMeta (md, edit, view, toc, tocAffix) {
|
|||
tocAffix.removeAttr('dir')
|
||||
}
|
||||
// breaks
|
||||
if (typeof breaks === 'boolean' && !breaks) {
|
||||
md.options.breaks = false
|
||||
if (typeof breaks === 'boolean') {
|
||||
md.options.breaks = breaks
|
||||
} else {
|
||||
md.options.breaks = true
|
||||
md.options.breaks = window.defaultUseHardbreak
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -979,7 +979,7 @@ function highlightRender (code, lang) {
|
|||
|
||||
export const md = markdownit('default', {
|
||||
html: true,
|
||||
breaks: true,
|
||||
breaks: window.defaultUseHardbreak,
|
||||
langPrefix: '',
|
||||
linkify: true,
|
||||
typographer: true,
|
||||
|
|
Loading…
Reference in New Issue