Emacs Quiz of the Day: replace-html-entities
Write a function “replace-html-entities”. If there is a text selection, work on the selection. Else, work on the current paragraph (defined by 2 line breaks)
Replace all named html entities such as
(see entity list here: HTML/XML Entities List.)
i'll post a answer on Monday.
If you are new to elisp, the following articles will be helpful. One of the article basically spills out the solution.
Note: for those who know elisp well, your command should also replace all entities in decimal form (e.g.
©) or hexadecimal form
There's a tricky part in this problem. Your code should not introduce extraneous transformation. For example, suppose the input file discusses HTML language, and it has this text in it:
©;. It should not become