wustho / epy

CLI Ebook (epub2, epub3, fb2, mobi) Reader
GNU General Public License v3.0
928 stars 52 forks source link

After blockquote an extra paragraph is indented #64

Open 3N4N opened 1 year ago

3N4N commented 1 year ago

Screenshot from 2022-09-27 13-21-26

The outlined paragraph is wrapped in a <p> tag. But it's being indented as if it's a blockquote, which the four lines above it are. The html of the relevant block is this:

   <blockquote class="quote">

      <p class="noindentfirst"><i class="calibre4">‘Oh, the Good Time has come at last,<br class="calibre1"/>
      To Mars we are a-going, sir,<br class="calibre1"/>
      Five Thousand Women in the sky,<br class="calibre1"/>
      That’s quite a springtime sowing, sir!</i>’</p>

    </blockquote>

    <p class="indent">‘That’s an old Wyoming song,’ said Leonora. ‘Change the words and it’s fine for 2003.’</p>
wustho commented 1 year ago

Oh, hmm, will look into that, pretty rare to find books with blockquote, so less books to test...

3N4N commented 1 year ago

Any update on this? I can help if you want.

wustho commented 1 year ago

Yes @3N4N , help would be so appreciated.

Just to give you heads up, there have been a major in project structure (from single module ./epy.py being broken down to package ./src/epy_reader/*). Because a single file with > 3000 lines is too big for LSP in development.

So, I think you might need to make a change in ./src/epy_reader/parser.py.

Currently I'm focusing on refactoring the structure, so everybody else can contribute easier. The current project sructure is temporary while I'm trying to refactor reader.py.

Thanks!

3N4N commented 1 year ago

I'll wait for the refactor to be done before making changes. Til then I can hardcode one less row for blockquotes. Won't be a problem.

wustho commented 1 year ago

@3N4N it's just one line? Can you make a PR for that? I'll look into it first, before continue refactoring (might take a little bit time and phases for refactoring)...

3N4N commented 1 year ago

I was talking about this line:

https://github.com/wustho/epy/blob/6dd186099b868a8f0998f0474663971a4b86324c/epy.py#L1209-L1210

Subtracting 2 instead of 1 fixes the issue. But by my understanding, 1 should be the correct number. Which means this fix is not actually a fix but a hack. A fix would have to locate the souce of the bug first.

If I find a legitimate solution, I'll open a PR.