Skip to content

Commit

Permalink
Ignore header line at fill-paragraph (#162)
Browse files Browse the repository at this point in the history
* Ignore header line at fill-paragraph
* Add test of #159 about fill-paragraph with header
  • Loading branch information
syohex authored and jrblevin committed Aug 29, 2016
1 parent 62d5b27 commit c063c1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6745,6 +6745,7 @@ or \\[markdown-toggle-inline-images]."
; options really only handle paragraph-starting prefixes,
; not paragraph-ending suffixes:
".* $" ; line ending in two spaces
"^#+"
"[ \t]*\\[\\^\\S-*\\]:[ \t]*$") ; just the start of a footnote def
"\\|"))
(set (make-local-variable 'adaptive-fill-first-line-regexp)
Expand Down
10 changes: 10 additions & 0 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -3595,6 +3595,16 @@ Detail: https://github.com/jrblevin/markdown-mode/issues/79"
(back-to-indentation)
(should-not (looking-at-p "\\*foo")))))

(ert-deftest test-markdown-filling/ignore-header ()
"# Test fill-paragraph for containing header line paragraph.
https://github.com/jrblevin/markdown-mode/issues/159"
(markdown-test-string "# this is header line
this is not header line
"
(let ((fill-column 10))
(fill-paragraph)
(should (string= (buffer-substring (point) (line-end-position)) "# this is header line")))))

;;; Export tests:

(ert-deftest test-markdown-hook/xhtml-standalone ()
Expand Down

0 comments on commit c063c1f

Please sign in to comment.