]> git.lyx.org Git - lyx.git/blobdiff - src/BiblioInfo.cpp
(finishing patch -- question was restored, but there were still problems)
[lyx.git] / src / BiblioInfo.cpp
index b88546e7f135a9943fa759269ff9460b1fd2ffca..420eaa2177c87f9d1d05f92d939565fd60313136 100644 (file)
@@ -36,7 +36,7 @@
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
-#include "boost/regex.hpp"
+#include "support/regex.h"
 
 #include <set>
 
@@ -175,8 +175,8 @@ docstring convertLaTeXCommands(docstring const & str)
                // unicodesymbols has things in the form: \"{u},
                // whereas we may see things like: \"u. So we'll
                // look for that and change it, if necessary.
-               static boost::regex const reg("^\\\\\\W\\w");
-               if (boost::regex_search(to_utf8(val), reg)) {
+               static lyx::regex const reg("^\\\\\\W\\w");
+               if (lyx::regex_search(to_utf8(val), reg)) {
                        val.insert(3, from_ascii("}"));
                        val.insert(2, from_ascii("{"));
                }
@@ -491,7 +491,19 @@ docstring BibTeXInfo::expandFormat(string const & format,
                }
                else if (scanning_key)
                        key += char(thischar);
-               else if (richtext || !scanning_rich)
+               else if (richtext) {
+                       if (scanning_rich)
+                               ret += thischar;
+                       else {
+                               // we need to escape '<' and '>'
+                               if (thischar == '<')
+                                       ret += "&lt;";
+                               else if (thischar == '>')
+                                       ret += "&gt;";
+                               else 
+                                       ret += thischar;
+                       }       
+               }       else if (!scanning_rich /* && !richtext */)
                        ret += thischar;
                // else the character is discarded, which will happen only if
                // richtext == false and we are scanning rich text