diff --git a/blog/blogpost1.md4tj b/blog/blogpost1.md4tj index 09677f2..18c75e9 100644 --- a/blog/blogpost1.md4tj +++ b/blog/blogpost1.md4tj @@ -4,4 +4,4 @@ @@BLOGPOSTDATE 1677804254 # Blog post 1 blog text 1! -[Link to example.com!](https://www.example.com ()) \ No newline at end of file +[Link to example.com!](https://www.example.com) \ No newline at end of file diff --git a/blog/feed.xml b/blog/feed.xml index fe58749..0c38959 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -1,21 +1,21 @@ -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.elTue, 11 Jul 2023 09:19:23 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.elTue, 11 Jul 2023 09:45:27 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html -
+<br> -

Blog post 2

+<h1>Blog post 2</h1> -

blog text 2 text!

+<p>blog text 2 text!</p>
Thu, 02 Mar 2023 19:44:50 EST
Blog Post 1https://example.com/blog/blogpost1.htmlhttps://example.com/blog/blogpost1.html -
+<br> -

Blog post 1

+<h1>Blog post 1</h1> -

blog text 1!

+<p>blog text 1!</p> -

[Link to example.com!](https://www.example.com ())

+<p><a href="https://www.example.com">Link to example.com!</a></p>
Thu, 02 Mar 2023 19:44:14 EST
\ No newline at end of file diff --git a/blogpost1.html b/blogpost1.html index c6ed741..64a97b6 100644 --- a/blogpost1.html +++ b/blogpost1.html @@ -13,6 +13,6 @@

blog text 1!

-

[Link to example.com!](https://www.example.com ())

+

Link to example.com!

\ No newline at end of file diff --git a/md4tj.el b/md4tj.el index 121c72a..573ae85 100644 --- a/md4tj.el +++ b/md4tj.el @@ -366,6 +366,16 @@ ;; End md4tj blog stuff ;; md4tj rss stuff + +(defun md4tj-rss-escape-string-for-rss (str) + "Escape STR for RSS." + (replace-regexp-in-string "'" "'" + (replace-regexp-in-string "\"" """ + (replace-regexp-in-string ">" ">" + (replace-regexp-in-string "<" "<" + (replace-regexp-in-string "&" "&" + (replace-regexp-in-string "'" "'" str))))))) + (defun md4tj-rss-needs-rss () "Scans current buffer, returning t if needing rss." (save-excursion @@ -422,7 +432,7 @@ (md4tj-rss-begin-tag "title") (nth 0 (nth 1 eltfilelist)) (md4tj-rss-end-tag "title") (md4tj-rss-begin-tag "link") (nth 2 (nth 1 eltfilelist)) (md4tj-rss-end-tag "link") (md4tj-rss-begin-tag "guid") (nth 2 (nth 1 eltfilelist)) (md4tj-rss-end-tag "guid") - (md4tj-rss-begin-tag "description") (md4tj-parse-to-string (nth 0 eltfilelist)) (md4tj-rss-end-tag "description") + (md4tj-rss-begin-tag "description") (md4tj-rss-escape-string-for-rss (md4tj-parse-to-string (nth 0 eltfilelist))) (md4tj-rss-end-tag "description") (md4tj-rss-begin-tag "pubDate") (format-time-string "%a, %d %b %Y %H:%M:%S %Z" (string-to-number (nth 1 (nth 1 eltfilelist)))) (md4tj-rss-end-tag "pubDate") (md4tj-rss-end-tag "item"))) diff --git a/test_file.html b/test_file.html index 863fdf3..c4f7d2b 100644 --- a/test_file.html +++ b/test_file.html @@ -75,7 +75,7 @@ int main() {

This is a div that has monospace text.

-

Last updated: Tue Jul 11 09:19:23 2023

+

Last updated: Tue Jul 11 09:45:26 2023