Skip to content

Commit

Permalink
Move point past comment opening
Browse files Browse the repository at this point in the history
Fixes GH-117, where <!-- > test --> was not being highlighted
or uncommented correctly.
  • Loading branch information
jrblevin committed Mar 12, 2016
1 parent 77fce3f commit 11199da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1910,13 +1910,15 @@ start which was previously propertized."
(let ((open-beg (match-beginning 0)))
(put-text-property open-beg (1+ open-beg)
'syntax-table (string-to-syntax "<"))
(markdown-syntax-propertize-comments (1+ open-beg) end)))
(markdown-syntax-propertize-comments
(min (1+ (match-end 0)) end (point-max)) end)))
;; Comment end
((and in-comment
(re-search-forward markdown-regex-comment-end end t))
(put-text-property (1- (match-end 0)) (match-end 0)
'syntax-table (string-to-syntax ">"))
(markdown-syntax-propertize-comments (match-end 0) end))
(markdown-syntax-propertize-comments
(min (1+ (match-end 0)) end (point-max)) end))
;; Nothing found
(t nil))))

Expand Down
6 changes: 6 additions & 0 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,12 @@ for (var i = 0; i < 10; i++) {
(markdown-test-range-face-equals (point-min) (1- (point-max))
markdown-comment-face)))

(ert-deftest test-markdown-font-lock/comment-angle-bracket ()
"Regression test for GH-117."
(markdown-test-string "<!-- > test -->"
(markdown-test-range-face-equals (point-min) (1- (point-max))
markdown-comment-face)))

(ert-deftest test-markdown-font-lock/footnote-markers-links ()
"Test an edge case involving footnote markers and inline reference links."
(markdown-test-string "Harvard[^1] [tuition][]"
Expand Down

0 comments on commit 11199da

Please sign in to comment.