View Single Post
Old 02-12-2020, 04:01 PM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,083
Karma: 148029447
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
It's a pretty simplistic solution. First I convert the 4 flavours of curly quotes into strings of ~ and % and then convert those back into curly quotes.

“ => ~%~% => ‘
” => %~%~ => ’
‘ => ~%%~ => “
’ => %~~% => ”

So the sentence I used in my sample comes out looking like after the first pass:

Code:
<p>John said ~%%~I asked Bill and he said ~%~%You should be ashamed of yourself.%~%~ %~~%</p>
I do check first to make sure that someone has not used one of those strings but so far, that has not happened. I also use a cleanup search for a double curly quote between two letters which gets replaced by a right single curly quote if needed. Given that you should never see a curly quote in the code segment, this pretty much covers my needs. These are part of my saved searches.
That should work rather well for what I want. It will make reading some books easier.
JSWolf is offline   Reply With Quote