diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2024-08-25 15:07:27 +0200 |
---|---|---|
committer | Vasilij Schneidermann <mail@vasilij.de> | 2024-08-25 15:07:27 +0200 |
commit | 13ba2fe401c1ebc786317e5eca3cc06bddbf8cbd (patch) | |
tree | cc21f2980fad4ac10165dbd4d469ec35991c536a /nov.el | |
parent | 32ded63420134d9995426910c5f5d9f5bd29fff8 (diff) |
Improve NXC TOC rendering performance
For some reason, the entity encoding helper from xml.el is about 10x
as slow as the one from url-util.el. On a particularly complicated NCX
file, this dropped rendering times from 3.9s to 1.1s...
Diffstat (limited to 'nov.el')
-rw-r--r-- | nov.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -50,7 +50,7 @@ (require 'seq) (require 'shr) (require 'url-parse) -(require 'xml) +(require 'url-util) (require 'bookmark) (require 'easymenu) @@ -406,8 +406,8 @@ Each alist item consists of the identifier and full path." (when (not href) (error "Navigation point is missing href attribute")) (let ((link (format "<a href=\"%s\">%s</a>" - (xml-escape-string href) - (xml-escape-string (or label href))))) + (url-insert-entities-in-string href) + (url-insert-entities-in-string (or label href))))) (if children (progn (insert (format "<li>\n%s\n<ol>\n" link)) |