diff --git a/xdxf.cc b/xdxf.cc index dc90e58f..dd718910 100644 --- a/xdxf.cc +++ b/xdxf.cc @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -1208,7 +1209,10 @@ vector< sptr< Dictionary::Class > > makeDictionaries( idxHeader.langTo = LangCoder::findIdForLanguageCode3( str.c_str() ); bool isLogical = ( stream.attributes().value( "format" ) == "logical" ); - idxHeader.revisionNumber = stream.attributes().value( "revision" ).toString().toUInt(); + + QRegExp regNum( "\\d+" ); + regNum.indexIn( stream.attributes().value( "revision" ).toString() ); + idxHeader.revisionNumber = regNum.cap().toUInt(); idxHeader.articleFormat = isLogical ? Logical : Visual; diff --git a/xdxf2html.cc b/xdxf2html.cc index 21f8a6ea..24d2605d 100644 --- a/xdxf2html.cc +++ b/xdxf2html.cc @@ -310,8 +310,12 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const { QDomElement el = nodes.at( 0 ).toElement(); + QString ref = el.attribute( "href" ); + if( ref.isEmpty() ) + ref = el.text(); + + el.setAttribute( "href", ref ); el.setTagName( "a" ); - el.setAttribute( "href", el.text() ); } // Abbreviations