mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
allows compact definition lists
This commit is contained in:
@@ -46,10 +46,12 @@ module.exports = function definitionListPlugin (md) {
|
|||||||
listLines,
|
listLines,
|
||||||
listTokIdx,
|
listTokIdx,
|
||||||
max,
|
max,
|
||||||
|
newEndLine,
|
||||||
nextLine,
|
nextLine,
|
||||||
offset,
|
offset,
|
||||||
oldDDIndent,
|
oldDDIndent,
|
||||||
oldIndent,
|
oldIndent,
|
||||||
|
oldLineMax,
|
||||||
oldParentType,
|
oldParentType,
|
||||||
oldSCount,
|
oldSCount,
|
||||||
oldTShift,
|
oldTShift,
|
||||||
@@ -150,7 +152,16 @@ module.exports = function definitionListPlugin (md) {
|
|||||||
state.tight = true
|
state.tight = true
|
||||||
state.parentType = 'deflist'
|
state.parentType = 'deflist'
|
||||||
|
|
||||||
state.md.block.tokenize(state, ddLine, endLine, true)
|
newEndLine = ddLine
|
||||||
|
while (++newEndLine < endLine && (state.sCount[newEndLine] >= state.sCount[ddLine] || state.isEmpty(newEndLine))) {
|
||||||
|
}
|
||||||
|
|
||||||
|
oldLineMax = state.lineMax
|
||||||
|
state.lineMax = newEndLine
|
||||||
|
|
||||||
|
state.md.block.tokenize(state, ddLine, newEndLine, true)
|
||||||
|
|
||||||
|
state.lineMax = oldLineMax
|
||||||
|
|
||||||
// If any of list item is tight, mark list as tight
|
// If any of list item is tight, mark list as tight
|
||||||
if (!state.tight || prevEmptyEnd) {
|
if (!state.tight || prevEmptyEnd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user