epy icon indicating copy to clipboard operation
epy copied to clipboard

After blockquote an extra paragraph is indented

Open 3N4N opened this issue 3 years ago • 6 comments

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>

3N4N avatar Sep 27 '22 07:09 3N4N

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

wustho avatar Sep 27 '22 11:09 wustho

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

3N4N avatar Oct 09 '22 18:10 3N4N

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!

wustho avatar Oct 09 '22 22:10 wustho

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.

3N4N avatar Oct 09 '22 22:10 3N4N

@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)...

wustho avatar Oct 09 '22 22:10 wustho

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.

3N4N avatar Oct 09 '22 22:10 3N4N