![]() |
#3661 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
|
![]() |
![]() |
#3662 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
Advert | |
|
![]() |
#3663 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
Hi, I'm using the code
Code:
replace_br_with_p: false Did I need a space before "replace_br_with_p: false" or was I supposed to change "false" to "true?" Thanks, Amalthia |
![]() |
![]() |
#3664 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
As for 'not working', you'll have to be more specific. That's a feature one of the other developers added. I don't use it, so I'm not terribly familiar with it. |
|
![]() |
![]() |
#3665 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
Quote:
I tried again with "replace_br_with_p: true" and still the same results. Thanks, Amalthia |
|
![]() |
Advert | |
|
![]() |
#3666 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
I've dropped a note to the developer who added that feature asking them to come take a look.
|
![]() |
![]() |
#3667 | |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
|
Quote:
I'll have a look though. |
|
![]() |
![]() |
#3668 |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
|
Addition, it's been a long time since I wrote that code, and IIRC it won't convert breaks inside a paragraph (<p>) tag.
I'll see if I can add a rule to ignore that rule. in cases where there are lot of the breaks. Additional: (again) It is as I suspected, the function shields break tags inside existing block tags (table, blockquote, p etc) as they usually mean that the text in question is pre-formatted with line breaks, rather than paragraph breaks. This could be for songs or poetry, or quotes inside a story. The trick is to come up with a rule that'll allow me to determine if I should overrule this, and when, without breaking the cases the old rule was meant to shield. I know where it fails, I just need to figure out how to best fix it, as it is really something AO3 is doing. However others might be doing the same thing. Heuristics are hard! P.S.: Jimm, I pushed a modified hpfanficarchive adapter, as I found that it left HTML comments in the story body, which would then become a garbled mess later, I don't know if that was something my br_to_p function did, but the result was that for instance Google Books wouldn't parse the output. So I simply remove all HTML comments. They serve no purpose in a story anyway. Last edited by Feynor; 01-23-2015 at 05:14 PM. Reason: Additional data |
![]() |
![]() |
#3669 | ||
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
Quote:
|
||
![]() |
![]() |
#3670 |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
|
The ? means the expression is lazy, and will match as few times as possible.
"<!-- comment --> story <!-- comment -->" will leave " story " Any hpfanficarchive story will do, they all have the comments. Here's the first story in latest: http://hpfanficarchive.com/stories/v...=834&chapter=1 the body found by the adapter starts with <!-- STORY START --> and ends with <!-- STORY END --> The heuristics code only really have one change, an if was changed to a while loop, to remove multiple layers of divs. AO3 uses 2. That really should be changed to using beautiful soup for safety, as it might be a problem for this structure: <div> <div>something</div> <div>Something else</div> </div> I didn't realize that till just now, so it might be a good idea to roll back that change for now.. Edit: I just reverted that change, so there is nothing to test in the heuristics for now. I have to figure out how to solve this. Last edited by Feynor; 01-23-2015 at 07:10 PM. |
![]() |
![]() |
#3671 | ||
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
![]() Quote:
Because if that's true, we should add an option to remove comments for all sites, not just hpfanficarchive. |
||
![]() |
![]() |
#3672 |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
|
Google Books don't mind comments, but somehow the comments from hpfanficarchive becomes messed up, looking like "<!-- <!-- STORY START --> <p>--></p>" if I recall
The nesting of comments is what's illegal, regular browsers just tries to ignore it. I only noticed it from hpfanficarcive, but it is a good idea to filter out them all, really, but it'll have to be done right after the adapter returns then, before any further processing. Last edited by Feynor; 01-23-2015 at 09:44 PM. |
![]() |
![]() |
#3673 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
We saw it last month when I changed how base_adapter converted soups to unicode so it was the same for BS3 and BS4. I had to make a change to the bundled BeautifulSoup3. See change rev 1537. Plus, I'm not seeing it the epub I generate from that hpfanficarchive story. Is your code base up to date? Last edited by JimmXinu; 01-23-2015 at 09:59 PM. Reason: Grammar fix. |
|
![]() |
![]() |
#3674 | |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
|
Quote:
I'm not having a good day it seems :P |
|
![]() |
![]() |
#3675 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jan 2015
Device: Android
|
Is it possible to include more than the story summary in the "comments" metadata section in Calibre? I'd also like to automatically include ratings and word counts if possible. I've tried reading the wiki but it's all a bit confusing for this beginner.
|
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Count Pages | kiwidude | Plugins | 1849 | 08-30-2025 01:22 PM |
[GUI Plugin] Resize Cover | kiwidude | Plugins | 100 | 07-10-2025 08:50 AM |
[GUI Plugin] Find Duplicates | kiwidude | Plugins | 1124 | 04-18-2025 09:19 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 05:42 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |