From a0a94ab006f5f522d4fd9c80594cc2dd73f32a9f Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 1 Jun 2023 03:10:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Make=20field=5Flist=20compatible?= =?UTF-8?q?=20with=20latest=20upstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/executablebooks/markdown-it-py/pull/270 deprecates `srcCharCode` and makes it immutable. --- mdit_py_plugins/field_list/__init__.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mdit_py_plugins/field_list/__init__.py b/mdit_py_plugins/field_list/__init__.py index 6a4e82e..be34cb3 100644 --- a/mdit_py_plugins/field_list/__init__.py +++ b/mdit_py_plugins/field_list/__init__.py @@ -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 @@ -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