]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

First =, - should not be treated as header
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Tue, 19 Jan 2016 00:53:32 +0000 (09:53 +0900)
committerHiroshi Shirosaki <h.shirosaki@gmail.com>
Tue, 19 Jan 2016 00:57:15 +0000 (09:57 +0900)
Fix #189

syntax/markdown.vim
test/syntax.vader

index 7e064714fdda73d79b5002a3dc4ad922c6006bad..63429b3618e805fa50a457c21c513159d14a479f 100644 (file)
@@ -66,6 +66,16 @@ syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+     end=+"+  contained
 syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+     end=+'+  contained
 syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+     end=+)+  contained
 
 syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+     end=+'+  contained
 syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+     end=+)+  contained
 
+"HTML headings
+syn region htmlH1       start="^\s*#"                   end="$" contains=@Spell
+syn region htmlH2       start="^\s*##"                  end="$" contains=@Spell
+syn region htmlH3       start="^\s*###"                 end="$" contains=@Spell
+syn region htmlH4       start="^\s*####"                end="$" contains=@Spell
+syn region htmlH5       start="^\s*#####"               end="$" contains=@Spell
+syn region htmlH6       start="^\s*######"              end="$" contains=@Spell
+syn match  htmlH1       /^.\+\n=\+$/ contains=@Spell
+syn match  htmlH2       /^.\+\n-\+$/ contains=@Spell
+
 "define Markdown groups
 syn match  mkdLineContinue ".$" contained
 syn match  mkdLineBreak    /  \+$/
 "define Markdown groups
 syn match  mkdLineContinue ".$" contained
 syn match  mkdLineBreak    /  \+$/
@@ -88,16 +98,6 @@ syn match  mkdRule         /^\s*_\s\{0,1}_\s\{0,1}_$/
 syn match  mkdRule         /^\s*-\{3,}$/
 syn match  mkdRule         /^\s*\*\{3,5}$/
 
 syn match  mkdRule         /^\s*-\{3,}$/
 syn match  mkdRule         /^\s*\*\{3,5}$/
 
-"HTML headings
-syn region htmlH1       start="^\s*#"                   end="$" contains=@Spell
-syn region htmlH2       start="^\s*##"                  end="$" contains=@Spell
-syn region htmlH3       start="^\s*###"                 end="$" contains=@Spell
-syn region htmlH4       start="^\s*####"                end="$" contains=@Spell
-syn region htmlH5       start="^\s*#####"               end="$" contains=@Spell
-syn region htmlH6       start="^\s*######"              end="$" contains=@Spell
-syn match  htmlH1       /^.\+\n=\+$/ contains=@Spell
-syn match  htmlH2       /^.\+\n-\+$/ contains=@Spell
-
 " YAML frontmatter
 if get(g:, 'vim_markdown_frontmatter', 0)
   syn include @yamlTop syntax/yaml.vim
 " YAML frontmatter
 if get(g:, 'vim_markdown_frontmatter', 0)
   syn include @yamlTop syntax/yaml.vim
index ebd197eae7e133040f1556d164c1faa9eebee800..7d6f6b14cf2247e49ced8ed6829839e8ede198fb 100644 (file)
@@ -267,6 +267,18 @@ Execute (fenced code block syntax with an unknown language specifier):
   call b:func(0)
   AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
 
   call b:func(0)
   AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
 
+
+Given markdown;
+```
+=
+a
+-
+```
+
+Execute (first = or - in fenced code block is not setex headers):
+  AssertEqual SyntaxOf('='), 'mkdCode'
+  AssertEqual SyntaxOf('-'), 'mkdCode'
+
 # Math
 
 Given markdown;
 # Math
 
 Given markdown;