|
@ -1,6 +1,6 @@ |
|
|
// heading (#, ##, ...)
|
|
|
// heading (#, ##, ...)
|
|
|
|
|
|
|
|
|
import { isSpace } from '../common/utils.mjs' |
|
|
import { isSpace, trimMinimalSpaces } from '../common/utils.mjs' |
|
|
|
|
|
|
|
|
export default function heading (state, startLine, endLine, silent) { |
|
|
export default function heading (state, startLine, endLine, silent) { |
|
|
let pos = state.bMarks[startLine] + state.tShift[startLine] |
|
|
let pos = state.bMarks[startLine] + state.tShift[startLine] |
|
@ -40,7 +40,7 @@ export default function heading (state, startLine, endLine, silent) { |
|
|
token_o.map = [startLine, state.line] |
|
|
token_o.map = [startLine, state.line] |
|
|
|
|
|
|
|
|
const token_i = state.push('inline', '', 0) |
|
|
const token_i = state.push('inline', '', 0) |
|
|
token_i.content = state.src.slice(pos, max).trim() |
|
|
token_i.content = trimMinimalSpaces(state.src.slice(pos, max)) |
|
|
token_i.map = [startLine, state.line] |
|
|
token_i.map = [startLine, state.line] |
|
|
token_i.children = [] |
|
|
token_i.children = [] |
|
|
|
|
|
|
|
|