示例:
<p>Um diese App verwenden zu können, benötigen Sie JavaScript.</p>
应替换为:
<p>Um diese App verwenden zu können, benötigen Sie JavaScript.</p>
是否存在在区域上执行此类替换的现有功能或包?
答案 0 :(得分:1)
评论后编辑,谢谢。
在此处下载文件html2uml.el:
http://bazaar.launchpad.net/~a-roehler/s-x-emacs-werkstatt/trunk/view/head:/html2uml.el
请在此处报告WRT错误或遗漏的实体:
https://bugs.launchpad.net/s-x-emacs-werkstatt
现在的代码:
(defvar ar-html2uml
'(
(" " " ")
("¡" "¡")
("¢" "¢")
("£" "£")
("¤" "\x{00A4}")
("¥" "¥")
("¦" "\x{00A6}")
("§" "§")
("¨" "\x{00A8}")
("©" "©")
("ª" "ª")
("«" "«")
("¬" "¬")
("­" "")
("®" "®")
("¯" "¯")
("°" "°")
("±" "±")
("²" "²")
("³" "³")
("´" "\x{00B4}")
("µ" "µ")
("¶" "¶")
("·" "·")
("¸" "\x{00B8}")
("¹" "¹")
("º" "º")
("»" "»")
("¼" "\x{00BC}")
("½" "\x{00BD}")
("¾" "\x{00BE}")
("¿" "¿")
("À" "À")
("Á" "Á")
("Â" "Â")
("Ã" "Ã")
("Ä" "Ä")
("Å" "Å")
("Æ" "Æ")
("Ç" "Ç")
("È" "È")
("É" "É")
("Ê" "Ê")
("Ë" "Ë")
("Ì" "Ì")
("Í" "Í")
("Î" "Î")
("Ï" "Ï")
("Ð" "Ð")
("Ñ" "Ñ")
("Ò" "Ò")
("Ó" "Ó")
("Ô" "Ô")
("Õ" "Õ")
("Ö" "Ö")
("×" "×")
("Ø" "Ø")
("Ù" "Ù")
("Ú" "Ú")
("Û" "Û")
("Ü" "Ü")
("Ý" "Ý")
("Þ" "Þ")
("ß" "ß")
("à" "à")
("á" "á")
("â" "â")
("ã" "ã")
("ä" "ä")
("å" "å")
("æ" "æ")
("ç" "ç")
("è" "è")
("é" "é")
("ê" "ê")
("ë" "ë")
("ì" "ì")
("í" "í")
("î" "î")
("ï" "ï")
("ð" "ð")
("ñ" "ñ")
("ò" "ò")
("ó" "ó")
("ô" "ô")
("õ" "õ")
("ö" "ö")
("\Ö" "Ö")
("÷" "÷")
("ø" "ø")
("ù" "ù")
("ú" "ú")
("û" "û")
("ü" "ü")
("ý" "ý")
("þ" "þ")
("ÿ" "ÿ")
))
(defun ar-uml2html ()
"Translate chars into html entities"
(interactive "*")
(let ((liste ar-html2uml)
case-fold-search erg)
(dolist (ele liste)
(goto-char (point-min))
(while (search-forward (cadr ele) nil t 1)
(setq erg (car ele))
;; Replacing with code starting from & upcases
;; Emacs bug?
(replace-match "")
(insert erg)))))
(defun ar-html2uml ()
"Translate html entities into text"
(interactive "*")
(let ((liste ar-html2uml))
(dolist (ele liste)
(goto-char (point-min))
(while (search-forward (car ele) nil t 1)
(replace-match "")
(insert (cadr ele))))))