Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions messages/next.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MarkdownEditing {version} Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

## New Features

## Changes
- embedded linter no longer complains on Bash- and Python-style comments in code blocks (previously it triggered the `MD023` rule)

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
14 changes: 14 additions & 0 deletions plugins/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,21 @@ class md023(mddef):
locator = r"^( +)((?:-+|=+)|(?:#{1,6}(?!#).*))$"
gid = 1

# 2025-05-14, studokim: the default implementation complains on bash comments in code blocks
def is_inside_code_block(self, text, s, e):
def calculate_intendation(text, position):
return position - text.rfind("\n", 0, position) - 1
keyword = "```"
block_s = text.rfind(keyword, 0, s-1)
block_e = text.find(keyword, e)
block_s_intendation = calculate_intendation(text, block_s)
block_e_intendation = calculate_intendation(text, block_e)
assert block_s_intendation == block_e_intendation # if fails, then the algorithm is wrong
return e - s >= block_s_intendation

def test(self, text, s, e):
if self.is_inside_code_block(text, s, e):
return {}
return {s: "%d spaces found" % (e - s)}


Expand Down