Skip to content

Commit a0a94ab

Browse files
authored
👌 Make field_list compatible with latest upstream
executablebooks/markdown-it-py#270 deprecates `srcCharCode` and makes it immutable.
1 parent 9cb9ff9 commit a0a94ab

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

‎mdit_py_plugins/field_list/__init__.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,11 @@ def _fieldlist_rule(state: StateBlock, startLine: int, endLine: int, silent: boo
195195
# and replace the "hole" left with space,
196196
# so that src indexes still match
197197
diff = first_line_body_indent - block_indent
198-
state._src = (
198+
state.src = (
199199
state.src[: contentStart - diff]
200200
+ " " * diff
201201
+ state.src[contentStart:]
202202
)
203-
state.srcCharCode = (
204-
state.srcCharCode[: contentStart - diff]
205-
+ tuple([0x20] * diff)
206-
+ state.srcCharCode[contentStart:]
207-
)
208203

209204
state.tShift[startLine] = contentStart - diff - state.bMarks[startLine]
210205
state.sCount[startLine] = first_line_body_indent - diff
@@ -249,11 +244,9 @@ def temp_state_changes(state: StateBlock, startLine: int):
249244
oldTShift = state.tShift[startLine]
250245
oldSCount = state.sCount[startLine]
251246
oldBlkIndent = state.blkIndent
252-
oldSrc = state._src
253-
oldSrcCharCode = state.srcCharCode
247+
oldSrc = state.src
254248
yield
255249
state.blkIndent = oldBlkIndent
256250
state.tShift[startLine] = oldTShift
257251
state.sCount[startLine] = oldSCount
258-
state._src = oldSrc
259-
state.srcCharCode = oldSrcCharCode
252+
state.src = oldSrc

0 commit comments

Comments
 (0)