mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 13:33:04 +00:00

The format is: # var-name: value Previously snippets used a mixture of the following formatting: #var-name: value #var-name : value # var-name: value # var-name : value
18 lines
608 B
Plaintext
Executable File
18 lines
608 B
Plaintext
Executable File
# contributor: Xah Lee (XahLee.org)
|
|
# name: find and replace on region
|
|
# key: x-find-replace
|
|
# --
|
|
(defun replace-html-chars-region (start end)
|
|
"Replace “<” to “<” and other chars in HTML.
|
|
This works on the current region."
|
|
(interactive "r")
|
|
(save-restriction
|
|
(narrow-to-region start end)
|
|
(goto-char (point-min))
|
|
(while (search-forward "&" nil t) (replace-match "&" nil t))
|
|
(goto-char (point-min))
|
|
(while (search-forward "<" nil t) (replace-match "<" nil t))
|
|
(goto-char (point-min))
|
|
(while (search-forward ">" nil t) (replace-match ">" nil t))
|
|
)
|
|
) |