[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/markdown-mode a9cb230 2/2: Merge pull request #653 from jr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/markdown-mode a9cb230 2/2: Merge pull request #653 from jrblevin/issue-645-2 |
Date: |
Tue, 31 Aug 2021 11:57:32 -0400 (EDT) |
branch: elpa/markdown-mode
commit a9cb2308530dbe72c3bcb6a144b03dcd536e292b
Merge: 0839d07 1169bf1
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #653 from jrblevin/issue-645-2
Improve setext regexp for fill-paragraph
---
markdown-mode.el | 2 +-
tests/markdown-test.el | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/markdown-mode.el b/markdown-mode.el
index 35c2f07..5db1068 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -9730,7 +9730,7 @@ rows and columns and the column alignment."
;; not paragraph-ending suffixes:
".* $" ; line ending in two spaces
"^#+"
- "^[-=]+"
+ "^\\(?: \\)?[-=]+[ \t]*$" ;; setext
"[ \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 669c94a..cbc1bbc 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -5586,7 +5586,24 @@ Details:
https://github.com/jrblevin/markdown-mode/issues/638"
"))
(markdown-test-string input
(markdown-fill-paragraph)
- (should (string= (buffer-string) input)))))
+ (should (string= (buffer-string) input))))
+ (let ((input "Heading
+-
+"))
+ (markdown-test-string input
+ (markdown-fill-paragraph)
+ (should (string= (buffer-string) input))))
+ ;; leading 3 spaces and trailing spaces is ok
+ (let ((input "Heading
+ ==== \t\n"))
+ (markdown-test-string input
+ (markdown-fill-paragraph)
+ (should (string= (buffer-string) input))))
+ ;; fill-paragraph is applied for list element
+ (markdown-test-string "- foo
+bar baz"
+ (markdown-fill-paragraph)
+ (should (string= (buffer-string) "- foo bar baz"))))
;;; Export tests:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/markdown-mode a9cb230 2/2: Merge pull request #653 from jrblevin/issue-645-2,
ELPA Syncer <=