[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/markdown-mode 054ff99a4d 1/7: Escape minimal set of charac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/markdown-mode 054ff99a4d 1/7: Escape minimal set of characters in title |
Date: |
Tue, 11 Apr 2023 22:01:44 -0400 (EDT) |
branch: elpa/markdown-mode
commit 054ff99a4d0d2339c1474324c539ea753e5e5acf
Author: Mark A. Hershberger <mah@nichework.com>
Commit: Shohei YOSHIDA <syohex@gmail.com>
Escape minimal set of characters in title
Fixes cfclrk/markdown-xwidget#9
---
markdown-mode.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/markdown-mode.el b/markdown-mode.el
index 6bdf03abb2..77fb02a036 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -7445,6 +7445,12 @@ Standalone XHTML output is identified by an occurrence of
stylesheet-path)
"\" />"))
+(defun markdown-escape-title (title)
+ "Escape a minimum set of characters in TITLE so they don't clash with html."
+ (string-replace ">" ">"
+ (string-replace "<" "<"
+ (string-replace "&" "&" title))))
+
(defun markdown-add-xhtml-header-and-footer (title)
"Wrap XHTML header and footer with given TITLE around current buffer."
(goto-char (point-min))
@@ -7453,7 +7459,7 @@ Standalone XHTML output is identified by an occurrence of
"\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n"
"<head>\n<title>")
- (insert title)
+ (insert (markdown-escape-title title))
(insert "</title>\n")
(unless (= (length markdown-content-type) 0)
(insert
- [nongnu] elpa/markdown-mode updated (fee1b0773b -> 5d98592fe5), ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 601863bb56 6/7: Fix issue link, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 85570020fc 4/7: Add compat library, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 52ce98b929 2/7: Add tests for html escaping title, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 5d98592fe5 7/7: Merge pull request #760 from jrblevin/pr-758, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode e44119f881 3/7: Update CHANGES.md, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 4ee8965287 5/7: Replace string-replace with replace-regexp-in-string for compatibility, ELPA Syncer, 2023/04/11
- [nongnu] elpa/markdown-mode 054ff99a4d 1/7: Escape minimal set of characters in title,
ELPA Syncer <=