I'm using Ubuntu 17.04 and Geany 1.29.
I've activated the plugin and I've tried using it in different ways without success.
For example, I select a "**<**" character and click on **Replace characters in selection** and nothing happens.
The same for other characters like "**&**".
Also tried the opposite, select an entity like "**&**" and didn't work also. So I have no idea what's going on or how to use it.
Did you define the keybindings in the plugin manager?
Yes, and also used the menu in Tools -> HTML Replacement.
Well the insert special characters menu works for me from menu or keybinding.
Despite its name, and the example given in its plugin manager description, it does not automatically replace HTML chars like < > & ; etc probably because if it did then it would be kind of hard to type HTML and XML :)
Also note that automatic replacement only happens in those filetypes.
Yes, inserting worked for me, but I want to replace characters in a selection. I don't use the automatic mode either.
Have you tried selecting a character and try to replace it?
Like I said in the post above, the HTML chars < > ; & " and space are NOT replaced, and to clarify either automatically or manually (ie in selected text).
This is explicit in the code, and I guess having it not change those characters allowed large blocks of HTML/XML to be selected for replacement, which must have suited the workflow of the people who wrote it, because thats how it has worked from the first commit of replacement functions back in 2009 (before that it was just the insert menu).
A pull request that added another command that just replaced those characters might be accepted, but changing the default behaviour after all these years probably would not be accepted, people who actively use the plugin will be too used to it not replacing.
PS have raised #1610 to make the description not mention ampersand or other HTML chars.
Do you know another plugin to do what I need? Manually writing lots of entities is a pain.
You could try snippets, see the manual for how to allow non-alphabetic chars as snippet names.
Or you could simply replace all &space occurrances afterwards (or space ; for that one)
Hi, I solved it and wanted to share the solution in case anyone find this thread in the future.
There is a **Send Selection To** option in the **Edit -> Format** menu.
There I created a new **Custom Command** with this content: `recode ascii..html`
You need to install the `recode` command for it to work. It will translate the selected text to html, escaping the entities.
Closed #1609.
github-comments@lists.geany.org