*Note: Requires
Sigil v0.8.3 and later *
*Note: Do not rename any Sigil plugin zip files before installing *
This plugin will work with either Python 3.4+ or Python 2.7+ (defaults to 3.x if both are present).
The Shady Characters plugin will expose many invisible unicode characters that can elude the eye and make editing searching (x)html markup confusing.
It converts those "invisible" characters to their numeric entity equivalents (I chose numeric because it's less likely to cause errors in conjunction with DTDs--or lack thereof). You can then do to those entities what you want.
Currently it looks for:
thin space
soft hyphen
zero-width joiner
word-joiner
zero-width non-breaking space
narrow non-breaking space
non-breaking space (only for completeness ... the Sigil environment is pretty toxic to the non-breaking space character anyway)
If you wish to customize the characters searched for, and/or what they get replaced with, edit the ShadyCharacters.json file (<
Sigil preferences directory>/plugins_prefs/ShadyCharacters/ShadyCharacters.json). You will need to run the plugin at least once before the preference file exists. A single entry will look like:
Code:
"zwj": [
"0x200D",
"‍"
],
The first field ("zwj") is fairly meaningless... it's a label so you know what the character is (zero-width joiner in this case).
The second field ("0x200D") is a string representation of the hex value of the character being sought (please include the quotes and the "0x" prefix)
The third field ("‍") is the numeric entity that you wish to replace the character with when it's found (please note that the character will be replaced with whatever you choose to put here.)
In short:
Code:
"zwj": ["0x200D","‍"],
is one entry. The trailing comma is only necessary if there's another entry to follow, but it hurts nothing if it's there on the last entry.
*
Please note that if you edit the document in Book View after you convert the characters to entities with this plugin, they will be converted back to invisible characters (unless you have the numeric entities listed in Sigil's Preserve Entities preferences). Simply run the plugin again to turn them back to entities.