weituotian / md_numbered_headers

sublime text3 plugin for markdown, auto insert/update/remove header numbers
Apache License 2.0
9 stars 1 forks source link

[Bug] False detection of shebang #6

Open sky-joker opened 6 years ago

sky-joker commented 6 years ago

Hi, @weituotian.

Thank you very good plugin.

I noticed. if there is shebang in markdown malfunction occurs.

for example

err

Fixed the malfunction by correcting the source as follows.

--- before/example.py   2018-03-24 18:36:33.000000000 +0900
+++ after/example.py    2018-03-24 18:36:27.000000000 +0900
@@ -70,7 +70,7 @@
     def get_toc(self, begin, edit):

         # Search headings in docment
-        pattern_hash = "^#+?[^#]"
+        pattern_hash = "^#+?[^!#]"

         headings = self.view.find_all(pattern_hash)

thansk.

Kristinita commented 6 years ago

+1. It would be nice, if md_numbered_headers will ignore # symbols in all GitHub Flavored Markdown code blocks for any language.

Thanks.

weituotian commented 6 years ago

@sky-joker @Kristinita Great! this issue and the advice are excellent! i am attempted to find a way to do that!