[sf-lug] HTML, <PRE></PRE>, <-- -->, email & mime encoded ...
Akkana Peck
akkana at shallowsky.com
Wed Oct 2 16:55:06 PDT 2019
Rick Moen writes, in response to Michael Paoli's htmlquote utility:
> For quoting/unquoting HTML, I tend to just swear a bit and haul out
> sed/awk, but a brief search unearthed recode(1) as a likely time-saver.
I'm usually in emacs, editing an HTML file, when I want something
like Michael's htmlquote script, so I keep this in .emacs:
;; Run this on a region inside a <pre> to convert chars like < into entities.
(defun unhtml (start end)
(interactive "r")
(save-excursion
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(replace-string "&" "&")
(goto-char (point-min))
(replace-string "<" "<")
(goto-char (point-min))
(replace-string ">" ">")
)))
...Akkana
More information about the sf-lug
mailing list