Skip to content

Commit

Permalink
Ignore === headings inside fenced code blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
nelstrom committed Nov 30, 2012
1 parent c4e3c24 commit f5ee87d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion after/ftplugin/markdown/folding.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function! HeadingDepth(lnum)
let thisline = getline(a:lnum)
let hashCount = len(matchstr(thisline, '^#\{1,6}'))
if hashCount > 0
if LineIsFenced(a:lnum) | return 0 | endif
let level = hashCount
else
if thisline != ''
Expand All @@ -38,6 +37,10 @@ function! HeadingDepth(lnum)
endif
endif
endif
if level > 0 && LineIsFenced(a:lnum)
" Ignore # or === if they appear within fenced code blocks
let level = 0
endif
return level
endfunction

Expand Down

0 comments on commit f5ee87d

Please sign in to comment.