mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
fixed footnotes processing (do not trim footnotes if several paragraphs have ids)
This commit is contained in:
parent
8f5723782f
commit
1c04d1b5e5
2 changed files with 12 additions and 1 deletions
|
@ -37,6 +37,7 @@ FB2BookReader::FB2BookReader(BookModel &model) : myModelReader(model) {
|
|||
mySectionDepth = 0;
|
||||
myBodyCounter = 0;
|
||||
myReadMainText = false;
|
||||
myFootnoteTagDepth = 0;
|
||||
myCurrentImageStart = -1;
|
||||
mySectionStarted = false;
|
||||
myInsideTitle = false;
|
||||
|
@ -64,10 +65,15 @@ bool FB2BookReader::processNamespaces() const {
|
|||
}
|
||||
|
||||
void FB2BookReader::startElementHandler(int tag, const char **xmlattributes) {
|
||||
if (!myReadMainText && myFootnoteTagDepth > 0) {
|
||||
++myFootnoteTagDepth;
|
||||
}
|
||||
|
||||
const char *id = attributeValue(xmlattributes, "id");
|
||||
if (id != 0 && tag != _BINARY) {
|
||||
if (!myReadMainText) {
|
||||
if (!myReadMainText && myFootnoteTagDepth == 0) {
|
||||
myModelReader.setFootnoteTextModel(id);
|
||||
myFootnoteTagDepth = 1;
|
||||
}
|
||||
myModelReader.addHyperlinkLabel(id);
|
||||
}
|
||||
|
@ -255,6 +261,10 @@ void FB2BookReader::startElementHandler(int tag, const char **xmlattributes) {
|
|||
}
|
||||
|
||||
void FB2BookReader::endElementHandler(int tag) {
|
||||
if (!myReadMainText && myFootnoteTagDepth > 0) {
|
||||
--myFootnoteTagDepth;
|
||||
}
|
||||
|
||||
switch (tag) {
|
||||
case _P:
|
||||
case _LI:
|
||||
|
|
|
@ -40,6 +40,7 @@ private:
|
|||
int mySectionDepth;
|
||||
int myBodyCounter;
|
||||
bool myReadMainText;
|
||||
int myFootnoteTagDepth;
|
||||
bool myInsideCoverpage;
|
||||
std::size_t myParagraphsBeforeBodyNumber;
|
||||
std::string myCoverImageReference;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue