Giter Site home page Giter Site logo

Comments (2)

poire-z avatar poire-z commented on June 12, 2024 2

Doing the right thing for footnote popup is hard, so there are lots of heuristics (rules to try to do the best thing with most books, but that may not do the best thing with some books).

-- Try to extend footnote, to gather more text after target
flags = flags + 0x4000

(All these flags around here are so that we can test which bit cause issues - it's not tunable by the user, except by hacking this code: if you comment that line, you won't get your crappy 2nd line.)

The logic is quite complex, see the description at the top of the highlighted lines:
https://github.com/koreader/koreader-base/blob/493b784c9c15b1ff615db07d3c00a07a900f42d4/cre.cpp#L3278-L3456

Your target page looks like:
image

I assume the little text in Chinese above the lines are the chapter names these footnotes are for.
With our rules, the last footnote of these subsection will extend to include the title of the next section - which is bad. But in other context, it is usually for the best.
But that means you will get that only for the last footnote for a chapter

<h1 class="chapter-hd">注 释</h1>
<p class="footnote-split">引言</p>
<p class="footnote-text"><a id="footnote-prol01" href="prologue.xhtml#footnote-prol01-backlink">[1]:</a>No issue for this one.</p>
<p class="footnote-text"><a id="footnote-prol01" href="prologue.xhtml#footnote-prol01-backlink">[1]:</a>No issue for this one.</p>
<p class="footnote-text"><a id="footnote-prol01" href="prologue.xhtml#footnote-prol01-backlink">[1]:</a> issue with this one only.</p>
<p class="footnote-split">序言</p>
<p class="footnote-text-hint"><a id="footnote-pref0a" href="preface2.xhtml#footnote-pref0a-backlink">①:</a>Christine在英语中还有基督徒、基督的追随者之意。——译者注</p>

(scroll it right to see my text).

If you really want to not see it, you can make a book style tweak with:

p.footnote-split { page-break-before: always; }

so there's a page-break before the <p class="footnote-split">序言</p>, and our rules won't gather it:

        // We try to gather as much paragraphs (final nodes) after the
        // linked one, and stop when we meet:
        //   - a new <DocFragment> or <body>, or any of <h1>...<h6>
        //   - (before) a node with page-break-before: always/left/right   <= This will trigger
        //   - (after) a node with page-break-after: always/left/right
        //   - a node with an id= attribute, which may be the start of
        //     another footnote 

from koreader.

1pcr3ss avatar 1pcr3ss commented on June 12, 2024

yes, it's only the last one that has the issue. if the extend is intended then I figured out a workaround, just put the chapter name in heading tag but paragraph. :)

from koreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.