Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/mdit_py_plugins/utils.py: 57%

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

7 statements  

1from markdown_it.rules_block import StateBlock 

2 

3 

4def is_code_block(state: StateBlock, line: int) -> bool: 

5 """Check if the line is part of a code block, compat for markdown-it-py v2.""" 

6 try: 

7 # markdown-it-py v3+ 

8 return state.is_code_block(line) 

9 except AttributeError: 

10 pass 

11 

12 return (state.sCount[line] - state.blkIndent) >= 4