aboutsummaryrefslogtreecommitdiff
path: root/nov.el
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2020-11-21 12:49:11 +0100
committerVasilij Schneidermann <mail@vasilij.de>2020-11-21 12:49:11 +0100
commit7845e3d01ee608691c44328c2e9ef4f3394470af (patch)
tree3c800a04ee9f24db5bd4ca13d9cfea34cdd32d6b /nov.el
parent23e5d9c4c63e3a7dc08110a8dfcbb97a1186a37f (diff)
Encode attribute and text content in generated NCX
Diffstat (limited to 'nov.el')
-rw-r--r--nov.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/nov.el b/nov.el
index c8573d4..445e3c2 100644
--- a/nov.el
+++ b/nov.el
@@ -49,6 +49,7 @@
(require 'image)
(require 'shr)
(require 'url-parse)
+(require 'xml)
(require 'bookmark)
(require 'imenu)
@@ -366,7 +367,9 @@ Each alist item consists of the identifier and full path."
(label (car (esxml-node-children label-node))))
(when (not href)
(error "Navigation point is missing href attribute"))
- (let ((link (format "<a href=\"%s\">%s</a>" href (or label href))))
+ (let ((link (format "<a href=\"%s\">%s</a>"
+ (xml-escape-string href)
+ (xml-escape-string (or label href)))))
(if children
(progn
(insert (format "<li>\n%s\n<ol>\n" link))