mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 14:21:12 +08:00

* opti: container block preview * remove unused codes * rewrite createBlock method * remove ag-line classname * just push codes * hand enter + shift in paragraph * update import markdown and export markdown * update part updateCtrl * update indent code block * auto indent when press shift + enter * update thematic break * update inline syntax update reg * update list and task list * update atx heading and setext heading * update paragraph * update block quote * adjust cursor in heading * update codes * paragraph turn into feature check * check copy paste * update turn into * fix: delete last # error * fix: turn setext heading to atx heading error * fix: delete thematic break error * paste and copy * workarond turndown to support soft line break * fix: unable create table * modify export markdown * modify test markdown * fix: cursor error when update blockquote * readd cursor check when dispatch changes * fix: inline math create a lot extra char * add code cache clear after each render * fallback to prismjs2
18 lines
556 B
JavaScript
18 lines
556 B
JavaScript
import { CLASS_OR_ID } from '../../../config'
|
|
|
|
export default function softLineBreak (h, cursor, block, token, outerClass) {
|
|
const { spaces, lineBreak, isAtEnd } = token
|
|
const className = CLASS_OR_ID['AG_HARD_LINE_BREAK']
|
|
const spaceClass = CLASS_OR_ID['AG_HARD_LINE_BREAK_SPACE']
|
|
if (isAtEnd) {
|
|
return [
|
|
h(`span.${className}`, h(`span.${spaceClass}`, spaces)),
|
|
h(`span.${CLASS_OR_ID['AG_LINE_END']}`, lineBreak)
|
|
]
|
|
} else {
|
|
return [
|
|
h(`span.${className}`, [ h(`span.${spaceClass}`, spaces), lineBreak ])
|
|
]
|
|
}
|
|
}
|