Xah Talk Show 2020-07-15, emacs lisp command xah-html-remove-list

Xah Talk Show 2020-07-15, emacs lisp command xah-html-remove-list
(defun xah-html-remove-list ()
  "Remove HTML ul ol li list tags.
version 2020-07-15"
  (interactive)
  (let (p1 p2)

    (save-excursion
      (if (region-active-p)
          (progn
            (setq p1 (region-beginning))
            (setq p2 (region-end)))
        (progn
          (skip-chars-forward " \n\t")
          (when (re-search-backward "\n[ \t]*\n" nil "move")
            (re-search-forward "\n[ \t]*\n"))
          (setq p1 (point))
          (re-search-forward "\n[ \t]*\n" nil "move")
          (re-search-backward "\n[ \t]*\n" )
          (setq p2 (point)))))

    (save-restriction
      (narrow-to-region p1 p2)

      (goto-char 1)
      (while (search-forward "<ul>" nil t) (replace-match "" ))

      (goto-char 1)
      (while (search-forward "</ul>" nil t) (replace-match "" ))

      (goto-char 1)
      (while (search-forward "<ol>" nil t) (replace-match "" ))

      (goto-char 1)
      (while (search-forward "</ol>" nil t) (replace-match "" ))

      (goto-char 1)
      (while (search-forward "<li>" nil t) (replace-match "" ))

      (goto-char 1)
      (while (search-forward "</li>" nil t) (replace-match "" )))))

xah_talk_show_2020-07-15.txt

If you have a question, put $5 at patreon and message me.