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

7 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:15 +0000

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