emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/markdown-mode 55fa8c0 1/2: Fix fill paragraph with setext


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 55fa8c0 1/2: Fix fill paragraph with setext heading issue
Date: Sat, 14 Aug 2021 10:57:32 -0400 (EDT)

branch: elpa/markdown-mode
commit 55fa8c0a6d9e1b4531ae37b128a4e3487b2965af
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: Shohei YOSHIDA <syohex@gmail.com>

    Fix fill paragraph with setext heading issue
---
 CHANGES.md             |  2 ++
 markdown-mode.el       |  1 +
 tests/markdown-test.el | 10 ++++++++++
 3 files changed, 13 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index e2aacf1..170f4e4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -73,6 +73,7 @@
     -   Fix issue that executing `markdown-table-sort-lines` via menu-bar with 
older Emacs(< 28) [GH-641][]
     -   Fix wrong markdown table command issue in menu [GH-639][]
     -   Fix table conversion issue [GH-639][]
+    -   Fix fill paragraph issue with setext heading [GH-638][]
 
   [gh-290]: https://github.com/jrblevin/markdown-mode/issues/290
   [gh-311]: https://github.com/jrblevin/markdown-mode/issues/311
@@ -104,6 +105,7 @@
   [gh-631]: https://github.com/jrblevin/markdown-mode/issues/631
   [gh-634]: https://github.com/jrblevin/markdown-mode/issues/634
   [gh-635]: https://github.com/jrblevin/markdown-mode/issues/635
+  [gh-638]: https://github.com/jrblevin/markdown-mode/issues/638
   [gh-639]: https://github.com/jrblevin/markdown-mode/issues/639
   [gh-640]: https://github.com/jrblevin/markdown-mode/issues/640
   [gh-641]: https://github.com/jrblevin/markdown-mode/issues/641
diff --git a/markdown-mode.el b/markdown-mode.el
index 2efbfd1..93b5ed2 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -9730,6 +9730,7 @@ rows and columns and the column alignment."
                            ;; not paragraph-ending suffixes:
                            ".*  $" ; line ending in two spaces
                            "^#+"
+                           "^[-=]+"
                            "[ \t]*\\[\\^\\S-*\\]:[ \t]*$") ; just the start of 
a footnote def
                          "\\|"))
   (setq-local adaptive-fill-first-line-regexp "\\`[ \t]*[A-Z]?>[ \t]*?\\'")
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index ff1ed54..e8506d6 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -5566,6 +5566,16 @@ This includes preserving whitespace after the pipe."
       (fill-region (point-min) (point-max))
       (should (string-equal (buffer-string) text)))))
 
+(ert-deftest test-markdown-filling/setext-heading ()
+  "Fill paragraph at setext heading.
+Details: https://github.com/jrblevin/markdown-mode/issues/638";
+  (let ((input "Heading
+=======
+"))
+    (markdown-test-string input
+      (markdown-fill-paragraph)
+      (should (string= (buffer-string) input)))))
+
 ;;; Export tests:
 
 (ert-deftest test-markdown-hook/xhtml-standalone ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]