07-18-2017, 02:48 AM | #151 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
I was working on a book with some HTML comments and ran across this with Smarten Punctuation:
Before: <!--?xml version="1.0" encoding="UTF-8"?--> After: <!--?xml version=“1.0” encoding=“UTF-8”?--> Perhaps smartening should completely ignore HTML Comments? There is the possibility that comments could be designed in very specific ways (requiring unsmartened quotes). |
07-18-2017, 12:00 PM | #152 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
|
|
Advert | |
|
07-18-2017, 03:58 PM | #153 | |
Guru
Posts: 769
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
07-18-2017, 04:52 PM | #154 |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
|
07-18-2017, 05:19 PM | #155 | |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
As far as Smarten Punctuation goes, I assumed the SmartyPants algorithm could handle html comments. Perhaps I was wrong. But if it (or my plugin) can be easily tweaked to accommodate the issue, I'll certainly try to incorporate a fix into a new release when I get a chance. |
|
Advert | |
|
07-18-2017, 06:47 PM | #156 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
I'll definitely keep an eye out now that I noticed it. Quote:
Quote:
Before: Code:
<-- f'(x) = x + y --> <div class="formula"><img src="Formula1.png"/></div> Code:
<!--f’(x) = x + y--> <div class="formula"><img src="Formula1.png"/></div> Last edited by Tex2002ans; 07-18-2017 at 06:54 PM. |
|||
07-18-2017, 07:57 PM | #157 |
Guru
Posts: 769
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
I haven't paid much attention to it, but my impression (for what it's worth) is that it may be related to epub3 books converted to epub2 and opened in Sigil. I usually search and replace it out of existence and it has never come back, so I haven't spent a lot of time trying to track it down. And my hunch about where it's coming from may be way off base. Just thought I'd mention I've been seeing it a lot lately.
|
07-19-2017, 01:25 AM | #158 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
07-19-2017, 08:46 AM | #159 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
but then then there were multiple problems that cropped up:
Anyway, I don't want to clutter up this topic with formulas or MathML discussion. We can take this to PM, or discuss it in other topics (like my Tutorial: Formulas to PNG). I am more than happy to spitball ideas + discuss any of that stuff at any time. All I know is that comments should be ignored by smarteners! Sometimes there is smart stuff going on that needs to remain dumb! Last edited by Tex2002ans; 07-19-2017 at 08:48 AM. |
|
07-19-2017, 10:13 AM | #160 |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Making SmartyPants ignore this particular comment is pretty trivial. I just basically have to "get out of its way" with my plugin code. There are however, situations where there's html code contained within comments that SmartyPants will barf hard on regardless. Fixing that might not be trivial, but I'd rather work on a solution that ignores ALL html comments entirely rather than slapping something together that only fixes this specific comment.
|
07-19-2017, 03:44 PM | #161 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
Maybe a preprocessing pass that removes comments to store them in a list somewhere, then a post pass that puts them back? (I'm really just spitballing here, having not looked at the code.) |
|
07-19-2017, 04:04 PM | #162 | |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Luckily the fork of Python SmartyPants on PyPi, has a robust solution for handling html comments that I'm going to incorporate. Should have an updated version of the plugin very soon. Last edited by DiapDealer; 07-19-2017 at 04:06 PM. |
|
07-19-2017, 04:11 PM | #163 |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
In fact, if someone wants to give this test version a whirl and verify that it completely ignores html comments (without breaking something else, hopefully), I'd appreciate it!
EDIT: test attachment removed. New version is available on the first page. Last edited by DiapDealer; 07-19-2017 at 09:43 PM. |
07-19-2017, 04:53 PM | #164 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Is there a way to get the div and span processing to work with multiple HTML/XHTML files? If not, can such a function be written in?
|
07-19-2017, 05:17 PM | #165 | |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
You may have to add the plugin to the toolbar (editor preferences) if it's not already there. It's the same for all three tools provided by this Editor plugin. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sample Plugin for the Editor | DiapDealer | Editor | 77 | 12-10-2014 07:16 AM |
Diaps Editing Toolbag.zip Index Error | phossler | Editor | 2 | 10-01-2014 08:05 PM |
Editor plugin question | DiapDealer | Development | 2 | 07-28-2014 10:23 PM |
japi - a text editor capable of editing ePub directly | hekkel | ePub | 5 | 02-20-2009 08:46 AM |