Xah Talk Show 2024-05-03 Ep551 Emacs Lisp Coding, html add related box

(defun xahhtml-add-related-box ()
  "add a html div tag with class name rltd, to current text block.
Version: 2024-05-03"
  (interactive)
  (let (xp1 xp2 xtext)
    (seq-setq (xp1 xp2) (xah-get-pos-of-block-or))
    (setq xtext (buffer-substring-no-properties xp1 xp2))
    (delete-region xp1 xp2)
    (insert "<div class=\"rltd\">\n"
            xtext
            "\n</div>")))

task 2. fix this function xah-html-local-file-to-link. When a local file link contains a query string, you need to first remove the query string, then link the file, then add back the query string.

e.g.

file:///C:/Users/xah/web/xahlee_info/comp/unicode_index.html?q=power+-tel