From 9ef7c03a15a44921eca0b44b1cf1d99a15eec6a3 Mon Sep 17 00:00:00 2001 From: j4nk Date: Sat, 30 Mar 2024 20:57:33 -0400 Subject: [PATCH] Fixed issue where tags were not being properly closed within divs --- blog/feed.xml | 2 +- md4tj.el | 2 +- test_file.html | 18 +++++++++++++++++- test_file.md4tj | 8 +++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/blog/feed.xml b/blog/feed.xml index 77d6c30..042a1fc 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -1,4 +1,4 @@ -RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elSat, 30 Mar 2024 20:45:29 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html +RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elSat, 30 Mar 2024 20:57:14 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html <br> diff --git a/md4tj.el b/md4tj.el index eb84b2b..20307d2 100644 --- a/md4tj.el +++ b/md4tj.el @@ -112,7 +112,7 @@ "Last updated: " (format-time-string "%a %d %b %Y %H:%M UTC" nil t) (md4tj-end-tag "p"))) ((string-match "^@@DIV" line) (md4tj-begin-tag "div" (list (list "class" (nth 1 (split-string line)))))) - ((string-match "^@@ENDDIV" line) (md4tj-end-tag "div")) + ((string-match "^@@ENDDIV" line) (concat (mapconcat #'md4tj-state-to-html state "\n") (md4tj-end-tag "div"))) ((string-match "^@@BLOGINSERT" line) (with-current-buffer inbuf (md4tj-blog-html))) ((string-match "^@@RSSINSERT" line) (md4tj-rss-link-string (concat (with-current-buffer inbuf (save-excursion (md4tj-blog-base-url))) "feed.xml"))) ((and (string-match "^$$.*$$" line) (eq (nth 1 state) 'normal)) ;; LaTeX formula diff --git a/test_file.html b/test_file.html index 81d393c..436c883 100644 --- a/test_file.html +++ b/test_file.html @@ -5,6 +5,8 @@ + + Test webpage @@ -73,8 +75,9 @@ int main() {

This is a div that has monospace text.

+
-

Last updated: Sun 31 Mar 2024 00:45 UTC

+

Last updated: Sun 31 Mar 2024 00:57 UTC


@@ -111,5 +114,18 @@ int main() {

Content after the table

+ +
+
+ +
    +
  • This is a div that

  • + +
  • tests proper termination of list

  • + +
  • within it

  • +
+ +
\ No newline at end of file diff --git a/test_file.md4tj b/test_file.md4tj index 5ed24ff..b623607 100644 --- a/test_file.md4tj +++ b/test_file.md4tj @@ -44,4 +44,10 @@ This is a div that has monospace text. |----------|----------|---------| | *Item 1* | **Item 2** | ~~Item 3~~ | -Content after the table \ No newline at end of file +Content after the table + +@@DIV div2 +- This is a div that +- tests proper termination of list +- within it +@@ENDDIV \ No newline at end of file