@ -380,6 +380,10 @@ QTextDocument *Converter::convert(const QString &fileName)
if ( mSectionMap . contains ( link ) ) {
if ( mSectionMap . contains ( link ) ) {
block = mSectionMap . value ( link ) ;
block = mSectionMap . value ( link ) ;
} else {
const QString percentDecodedLink = QUrl : : fromPercentEncoding ( link . toUtf8 ( ) ) ;
if ( mSectionMap . contains ( percentDecodedLink ) ) {
block = mSectionMap . value ( percentDecodedLink ) ;
} else { // load missing resource
} else { // load missing resource
char * data = nullptr ;
char * data = nullptr ;
// epub_get_data can't handle whitespace url encodings
// epub_get_data can't handle whitespace url encodings
@ -412,6 +416,7 @@ QTextDocument *Converter::convert(const QString &fileName)
free ( data ) ;
free ( data ) ;
}
}
}
if ( block . isValid ( ) ) { // be sure we actually got a block
if ( block . isValid ( ) ) { // be sure we actually got a block
Q_EMIT addTitle ( epub_tit_get_curr_depth ( tit ) , QString : : fromUtf8 ( label ) , block ) ;
Q_EMIT addTitle ( epub_tit_get_curr_depth ( tit ) , QString : : fromUtf8 ( label ) , block ) ;