Skip to content

Commit 0672075

Browse files
committed
Dont allow None value for StateBase.src
1 parent 8290faa commit 0672075

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

markdown_it/ruler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def src(self):
4646
@src.setter
4747
def src(self, value):
4848
self._src = value
49-
self.srcCharCode = [ord(c) for c in self.src] if self.src is not None else []
49+
self.srcCharCode = [ord(c) for c in self.src]
5050

5151

5252
# The first positional arg is always a subtype of `StateBase`. Other

tests/test_api/test_main.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from markdown_it import MarkdownIt
22
from markdown_it.token import Token
3-
from markdown_it.rules_core import StateCore
43
from markdown_it.utils import AttrDict
54

65

@@ -248,18 +247,6 @@ def test_emptyStr():
248247
]
249248

250249

251-
def test_noneState():
252-
md = MarkdownIt()
253-
state = StateCore(None, md, {}, [])
254-
255-
# Remove normalizing rule
256-
rules = md.core.ruler.get_active_rules()
257-
md.core.ruler.enableOnly(rules[rules.index("inline") :])
258-
259-
# Check that we can process None str with empty env and block_tokens
260-
md.core.process(state)
261-
262-
263250
def test_empty_env():
264251
"""Test that an empty `env` is mutated, not copied and mutated."""
265252
md = MarkdownIt()

0 commit comments

Comments
 (0)