Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/markdown_it/rules_inline/text.py: 92%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

13 statements  

1# Skip text characters for text token, place those to pending buffer 

2# and increment current pos 

3from .state_inline import StateInline 

4 

5# Rule to skip pure text 

6 

7 

8def text(state: StateInline, silent: bool) -> bool: 

9 pos = state.pos 

10 posMax = state.posMax 

11 

12 terminator_char = state.md.inline.terminator_re.search(state.src, pos) 

13 pos = terminator_char.start() if terminator_char else posMax 

14 

15 if pos == state.pos: 

16 return False 

17 

18 if not silent: 

19 state.pending += state.src[state.pos : pos] 

20 

21 state.pos = pos 

22 

23 return True