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

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# '{}$%@~+=:' reserved for extensions 

7 

8# !!!! Don't confuse with "Markdown ASCII Punctuation" chars 

9# http://spec.commonmark.org/0.15/#ascii-punctuation-character 

10 

11 

12_TerminatorChars = { 

13 "\n", 

14 "!", 

15 "#", 

16 "$", 

17 "%", 

18 "&", 

19 "*", 

20 "+", 

21 "-", 

22 ":", 

23 "<", 

24 "=", 

25 ">", 

26 "@", 

27 "[", 

28 "\\", 

29 "]", 

30 "^", 

31 "_", 

32 "`", 

33 "{", 

34 "}", 

35 "~", 

36} 

37 

38 

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

40 pos = state.pos 

41 posMax = state.posMax 

42 while (pos < posMax) and state.src[pos] not in _TerminatorChars: 

43 pos += 1 

44 

45 if pos == state.pos: 

46 return False 

47 

48 if not silent: 

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

50 

51 state.pos = pos 

52 

53 return True