X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBibtex.cpp;h=876adea54b1770ad15a140a3a8d50eb2890edff5;hb=48b1e8a0aca2f3f3faa8f1f800568e47792ba9a0;hp=3e59d654ceba136f59b4f070c414ef5e55630246;hpb=3883b85f49054c109cb8a9a293721a5e41edb68d;p=lyx.git diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 3e59d654ce..876adea54b 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1183,28 +1183,26 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const string html = to_utf8(bibinfo.getInfo(entry.key(), buffer(), ci)); regex tagRegex("([^<]*)"); smatch match; - auto tagIt = std::sregex_iterator(html.cbegin(), html.cend(), tagRegex, regex_constants::match_default); - auto tagEnd = std::sregex_iterator(); + auto tagIt = lyx::sregex_iterator(html.cbegin(), html.cend(), tagRegex, regex_constants::match_default); + auto tagEnd = lyx::sregex_iterator(); map delayedTags; // Read all tags from HTML and convert those that have a 1:1 matching. while (tagIt != tagEnd) { string tag = tagIt->str(); // regex_match cannot work with temporary strings. ++tagIt; - std::regex_match(tag, match, tagRegex); - if (toDocBookTag.find(match[1]) == toDocBookTag.end()) { + if (regex_match(tag, match, tagRegex)) { + if (toDocBookTag[match[1]] == "SPECIFIC") { + delayedTags[match[1]] = match[2]; + } else { + xs << xml::StartTag(toDocBookTag[match[1]]); + xs << from_utf8(match[2].str()); + xs << xml::EndTag(toDocBookTag[match[1]]); + } + } else { LYXERR0("The BibTeX field " << match[1].str() << " is unknown."); xs << XMLStream::ESCAPE_NONE << from_utf8("\n"); - continue; - } - - if (toDocBookTag[match[1]] == "SPECIFIC") { - delayedTags[match[1]] = match[2]; - } else { - xs << xml::StartTag(toDocBookTag[match[1]]); - xs << from_utf8(match[2].str()); - xs << xml::EndTag(toDocBookTag[match[1]]); } }