Skip to content

Commit

Permalink
bump crengine: normalized xpointers fix, FB2 footnotes tweaks (#1055)
Browse files Browse the repository at this point in the history
Includes:
- toStringV2(): fix when target node is a boxing node
- CSS font-family parsing: set usual default of sans-serif
- FB2 footnotes: fix spurious newline ("display: run-in")
- FB2 footnotes: disable hardcoded handling as in-page

cre.cpp: accepts classic FB2 footnotes in footnote popup
detection
  • Loading branch information
poire-z authored Feb 27, 2020
1 parent 4913a46 commit 5f9bc28
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,36 @@ static bool _isLinkToFootnote(CreDocument *doc, const lString16 source_xpointer,
}
}

if (flags & 0x0008) { // Accept classic FB2 footnotes
// Similar checks as this CSS would do:
// body[name="notes"] section,
// body[name="comments"] section {
// -cr-hint: footnote;
// }
if ( targetNode->getNodeId() == doc->dom_doc->getElementNameIndex("section") ) {
lUInt16 el_body = doc->dom_doc->getElementNameIndex("body");
ldomNode * n = targetNode->getParentNode();
while ( n && !n->isNull() ) {
if ( n->getNodeId() == el_body ) {
lString16 name = n->getAttributeValue("name");
if (!name.empty()) {
name.lowercase();
if (name == "notes") {
reason = "target is FB2 footnote (body[name=notes] section)";
return true;
}
if (name == "comments") {
reason = "target is FB2 footnote (body[name=comments] section)";
return true;
}
}
break;
}
n = n->getParentNode();
}
}
}

if (flags & 0x0010) { // Target must have an anchor #id
// We should be called only with internal links, so they should
// all start with "#". But check that anyway.
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/kpvcrlib/crengine

0 comments on commit 5f9bc28

Please sign in to comment.