File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # MarkdownEditing {version} Changelog
2+
3+ Your _ MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
4+ feedback you can use [ GitHub issues] [ issues ] .
5+
6+ ## Bug Fixes
7+
8+ ## New Features
9+
10+ ## Changes
11+
12+ - embedded linter no longer complains on Bash- and Python-style comments in code blocks
13+ (previously it triggered the ` MD023 ` rule)
14+
15+ [ issues ] : https://github.com/SublimeText-Markdown/MarkdownEditing/issues
Original file line number Diff line number Diff line change @@ -591,7 +591,20 @@ class md023(mddef):
591591 locator = r"^( +)((?:-+|=+)|(?:#{1,6}(?!#).*))$"
592592 gid = 1
593593
594+ def is_inside_code_block (self , text , s , e ):
595+ def calculate_intendation (text , position ):
596+ return position - text .rfind ("\n " , 0 , position ) - 1
597+ keyword = "```"
598+ block_s = text .rfind (keyword , 0 , s - 1 )
599+ block_e = text .find (keyword , e )
600+ block_s_intendation = calculate_intendation (text , block_s )
601+ block_e_intendation = calculate_intendation (text , block_e )
602+ assert block_s_intendation == block_e_intendation
603+ return e - s >= block_s_intendation
604+
594605 def test (self , text , s , e ):
606+ if self .is_inside_code_block (text , s , e ):
607+ return {}
595608 return {s : "%d spaces found" % (e - s )}
596609
597610
You can’t perform that action at this time.
0 commit comments