commit 7b46aa8fbb013794da87ad5325750dd5ac1a81d3
Author: Richard Heck <[email protected]>
Date: Sun Feb 23 12:04:56 2014 -0500
Forgot in previous commit to deal with case. As I'm doing it now,
it's easy to use the existing docstring routine, so I've commented
out the string version of lowercase I had introduced. I've left the
code in case someone else needs it later.
diff --git a/src/Text3.cpp b/src/Text3.cpp
index f54e8f4..340bb9e 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1689,11 +1689,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// invalid after regex_match returns, since it is then
// being given a temporary object. (Thanks to Georg for
// figuring that out.)
- regex const link_re("^([a-zA-Z]+):.*");
+ regex const link_re("^([a-z]+):.*");
smatch matches;
- string const c = to_utf8(content);
+ string const c = to_utf8(lowercase(content));
- if (content.substr(0,7) == "mailto:") {
+ if (c.substr(0,7) == "mailto:") {
p["target"] = content;
p["type"] = from_ascii("mailto:");
} else if (regex_match(c, matches, link_re)) {
diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp
index 2d483e6..7af8aae 100644
--- a/src/support/lstrings.cpp
+++ b/src/support/lstrings.cpp
@@ -481,12 +481,14 @@ docstring const lowercase(docstring const & a)
}
+/* Uncomment here and in lstrings.h if you should need this.
string const lowercase(string const & a)
{
string tmp(a);
transform(tmp.begin(), tmp.end(), tmp.begin(), local_lowercase());
return tmp;
}
+*/
docstring const uppercase(docstring const & a)
diff --git a/src/support/lstrings.h b/src/support/lstrings.h
index 89450c7..576a5b9 100644
--- a/src/support/lstrings.h
+++ b/src/support/lstrings.h
@@ -96,8 +96,9 @@ docstring const ascii_lowercase(docstring const &);
/// Changes the case of \p s to lowercase.
/// Does not depend on the locale.
-std::string const lowercase(std::string const & s);
docstring const lowercase(docstring const & s);
+// Currently unused, but the code is there if needed.
+// std::string const lowercase(std::string const & s);
/// Changes the case of \p s to uppercase.
/// Does not depend on the locale.