Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions mdit_py_plugins/field_list/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,11 @@ def _fieldlist_rule(state: StateBlock, startLine: int, endLine: int, silent: boo
# and replace the "hole" left with space,
# so that src indexes still match
diff = first_line_body_indent - block_indent
state._src = (
state.src = (
state.src[: contentStart - diff]
+ " " * diff
+ state.src[contentStart:]
)
state.srcCharCode = (
state.srcCharCode[: contentStart - diff]
+ tuple([0x20] * diff)
+ state.srcCharCode[contentStart:]
)

state.tShift[startLine] = contentStart - diff - state.bMarks[startLine]
state.sCount[startLine] = first_line_body_indent - diff
Expand Down Expand Up @@ -249,11 +244,9 @@ def temp_state_changes(state: StateBlock, startLine: int):
oldTShift = state.tShift[startLine]
oldSCount = state.sCount[startLine]
oldBlkIndent = state.blkIndent
oldSrc = state._src
oldSrcCharCode = state.srcCharCode
oldSrc = state.src
yield
state.blkIndent = oldBlkIndent
state.tShift[startLine] = oldTShift
state.sCount[startLine] = oldSCount
state._src = oldSrc
state.srcCharCode = oldSrcCharCode
state.src = oldSrc