![]() |
Shady Characters plugin
1 Attachment(s)
*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": [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","‍"],*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. |
Added this to the official plugin threads list.
KevinH |
Quote:
|
this plugin is great framework for transliteration (well, serbian anyway). thanx a lot.
|
Quote:
|
sure. if i remember anything. :)
|
Quote:
https://www.fileformat.info/info/uni...200a/index.htm So I added this to the json: Code:
Code:
<h1>hair 8202 = =</h1>But the plugin doesn't find them. Quote:
Looked at your posts and see I need to use NOPARSE. |
This plugin was created before the Preserve Entities preference setting was added to Sigil. You should be able to add the hairsp entity (or any other invisible character entity) to your preserve entities list and Sigil will convert any characters found when saving or manually Mending/Prettifying. If not, then the hairspace entity may be being converted into some other character (for unknown reasons.
I'll take a look at why the plugin may be acting up on the hairspace char, though. Have you verified the plugin still even works with any of the invisible characters? Sigil's gone through many changes since its time. |
Quote:
But any changes I make to ShadyCharacters.json are reverted when I run the plugin. Even if I delete everything, when I run the plugin it just restores the default. Meanwhile; the preserve entities preference does work. |
I uploaded a fix for the plugin so that it actually saves and uses any user-added characters to the json prefs file. Mainly for posterity.
|
Thanks.
Quote:
At least it wasn't me screwing up. I kept thinking I had edited the wrong file or messed it up somehow. Quote:
I found this useful: https://www.w3schools.com/charsets/r...unctuation.asp Lists "punctuation" including a lot of esoteric spaces. |
Quote:
Quote:
|
| All times are GMT -4. The time now is 08:51 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.