File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 15
15
- Hide wikilink markup as part of ` markdown-toggle-markup-hiding ` [ GH-847 ] [ ]
16
16
- Angle URL fontify issue which was introduced by [ GH-861 ] [ ] [ GH-895 ] [ ]
17
17
- Fix list item bound calculation when tab indentation is used [ GH-904 ] [ ]
18
+ - Fix ` markdown-heading-at-point ` at the end of line [ GH-912 ] [ ]
18
19
19
20
* Improvements:
20
21
- Support drag and drop features on Windows and multiple files' drag and drop
29
30
[ gh-895 ] : https://github.com/jrblevin/markdown-mode/issues/895
30
31
[ gh-904 ] : https://github.com/jrblevin/markdown-mode/issues/904
31
32
[ gh-910 ] : https://github.com/jrblevin/markdown-mode/issues/910
33
+ [ gh-912 ] : https://github.com/jrblevin/markdown-mode/issues/912
32
34
33
35
# Markdown Mode 2.7
34
36
Original file line number Diff line number Diff line change @@ -2904,7 +2904,8 @@ data. See `markdown-inline-code-at-point-p' for inline code."
2904
2904
(defun markdown-heading-at-point (&optional pos)
2905
2905
"Return non-nil if there is a heading at the POS.
2906
2906
Set match data for `markdown-regex-header'."
2907
- (let ((match-data (get-text-property (or pos (point)) 'markdown-heading)))
2907
+ (let* ((p (or pos (if (and (eolp) (>= (point) 2)) (1- (point)) (point))))
2908
+ (match-data (get-text-property p 'markdown-heading)))
2908
2909
(when match-data
2909
2910
(set-match-data match-data)
2910
2911
t)))
Original file line number Diff line number Diff line change @@ -4398,7 +4398,11 @@ x: x
4398
4398
(forward-line -1)
4399
4399
(should (markdown-heading-at-point))
4400
4400
(should (equal (match-data t) (get-text-property (point) 'markdown-heading)))
4401
- (should (equal (match-data t) (get-text-property (point) 'markdown-heading-1-setext))))))
4401
+ (should (equal (match-data t) (get-text-property (point) 'markdown-heading-1-setext))))
4402
+ ;; Detail: https://github.com/jrblevin/markdown-mode/issues/912
4403
+ (markdown-test-string "# header\nsection"
4404
+ (goto-char (line-end-position))
4405
+ (should (markdown-heading-at-point)))))
4402
4406
4403
4407
(ert-deftest test-markdown-parsing/inline-link-in-code-block ()
4404
4408
"Test `markdown-match-generic-links'."
You can’t perform that action at this time.
0 commit comments