From a745a92579ff65d2941a1226383a80a00b0c490c Mon Sep 17 00:00:00 2001 From: Greg Hendershott Date: Wed, 15 Nov 2023 08:00:11 -0500 Subject: [PATCH] Ignore new elements These use "link" and "i" emoticons that... (a) render as \nnn byte strings, because we're using insert-file-contents-literally, and I don't have time now to figure out why we use that instead of insert-file-contents, and how to use the latter for encoding while avoiding whatever other behavior we wanted to avoid. (b) in a browser only show when the user hovers with the mouse, but in our case would appear always, after every main section heading, which is nosiy. Someday/maybe we should figure out a way to present the hidden information -- a "link here" URL, as well as the scribble source doc URL on GitHub -- that's appropriate for our UX. And then deal with the various ways this has been presented in Scribble HTML over time. --- racket-scribble.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/racket-scribble.el b/racket-scribble.el index 363af6c6..5bce1a6b 100644 --- a/racket-scribble.el +++ b/racket-scribble.el @@ -165,12 +165,18 @@ In some cases we resort to returning custom elements for (`(a ((name . ,name)) . ,xs) `(racket-anchor ((name . ,name)) . ,xs)) + ;; Ignore new elements. + (`(span ((class . "button-group")) . ,_) + `(span)) + ;; Replace with or . The ;; former are links to follow using racket-describe-mode, the ;; latter using browse-url (a general-purpose, probably external ;; web browser). (`(a ,_ . ,xs) (pcase (dom-attr dom 'href) + ;; No href. + (`() `(span () ,@(mapcar #'racket--walk-dom xs))) ;; Handle "local-redirect" links. Scribble writes these as ;; external links, and generates doc/local-redirect.js to ;; adjust these on page load. Partially mimic that js here.