branch: externals/devdocs commit 6a325cc29ad0cb27e8e54ba9c7b2d103f2b35ebd Author: Augusto Stoffel <arstof...@gmail.com> Commit: Augusto Stoffel <arstof...@gmail.com>
Make pre block fontification extend to the end of the line --- devdocs.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/devdocs.el b/devdocs.el index 5658806..a2fc46a 100644 --- a/devdocs.el +++ b/devdocs.el @@ -276,13 +276,10 @@ with the order of appearance in the text." (defun devdocs--shr-tag-pre (dom) "Insert and fontify pre-tag represented by DOM." - (let ((shr-folding-mode 'none) (shr-current-font 'default) start) - (shr-ensure-newline) - (setq start (point)) - (shr-generic dom) + (let ((start (point))) + (shr-tag-pre dom) (when-let ((lang (dom-attr dom 'data-language))) - (org-src-font-lock-fontify-block (downcase lang) start (point))) - (shr-ensure-newline))) + (org-src-font-lock-fontify-block (downcase lang) start (point))))) (defun devdocs--render (entry) "Render a DevDocs documentation entry, returning a buffer. @@ -297,9 +294,8 @@ fragment part of ENTRY.path." (devdocs-mode)) (let-alist entry (let ((buffer-read-only nil) - (shr-external-rendering-functions - (cons '(pre . devdocs--shr-tag-pre) - shr-external-rendering-functions)) + (shr-external-rendering-functions (cons '(pre . devdocs--shr-tag-pre) + shr-external-rendering-functions)) (file (expand-file-name (format "%s/%s.html" .doc (url-hexify-string (devdocs--path-file .path))) devdocs-data-dir)))