Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun roadie-htmlegalize-region (b e)
- "Replace \"&\", \"<\", and \">\" with their HTML escape codes, from B to E.
- Is there anything else that should be done to escape HTML?"
- (interactive "r")
- (save-excursion
- (let ((em (copy-marker e)))
- (goto-char b)
- (while (search-forward " & " em t)
- (replace-match " & " nil t))
- (goto-char b)
- (while (search-forward " < " em t)
- (replace-match " < " nil t))
- (goto-char b)
- (while (search-forward " > " em t)
- (replace-match " > " nil t))
- (goto-char b)
- (while (search-forward "ä" em t)
- (replace-match "ä" nil t))
- (goto-char b)
- (while (search-forward "ö" em t)
- (replace-match "ö" nil t))
- (goto-char b)
- (while (search-forward "ü" em t)
- (replace-match "ü" nil t))
- (goto-char b)
- (while (search-forward "Ä" em t)
- (replace-match "Ä" nil t))
- (goto-char b)
- (while (search-forward "Ö" em t)
- (replace-match "Ö" nil t))
- (goto-char b)
- (while (search-forward "Ü" em t)
- (replace-match "Ü" nil t))
- (goto-char b)
- (while (search-forward "ß" em t)
- (replace-match "ß" nil t))
- )))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement