Bug Fix - Bug #248
- Fixed bug where both single and double quotes are stored as ampersand-quote-semi-colon, leading to the gradual conversion of one to the other. Fix is backward compatible. Thanks to John Florian.
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
confused a subsequent import (thanks to John Florian).
|
||||
+ Fixed bug #241 that caused redirected output to retain color control codes
|
||||
for colored header and footnotes (thanks to John Florian).
|
||||
+ Fixed bug #248 where single and double quotes are both stored as
|
||||
ampersand-quot-semi (thanks to John Florian).
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
|
||||
14
src/Att.cpp
14
src/Att.cpp
@@ -711,8 +711,11 @@ void Att::encode (std::string& value) const
|
||||
while ((i = value.find ('\t')) != std::string::npos)
|
||||
value.replace (i, 1, "&tab;"); // no i18n
|
||||
|
||||
while ((i = value.find ('\'')) != std::string::npos)
|
||||
value.replace (i, 1, "&squot;"); // no i18n
|
||||
|
||||
while ((i = value.find ('"')) != std::string::npos)
|
||||
value.replace (i, 1, """); // no i18n
|
||||
value.replace (i, 1, "&dquot;"); // no i18n
|
||||
|
||||
while ((i = value.find (',')) != std::string::npos)
|
||||
value.replace (i, 1, ","); // no i18n
|
||||
@@ -730,7 +733,8 @@ void Att::encode (std::string& value) const
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Decode values after parse.
|
||||
// \t <- &tab;
|
||||
// " <- "
|
||||
// " <- " or &dquot;
|
||||
// ' <- &squot;
|
||||
// , <- ,
|
||||
// [ <- &open;
|
||||
// ] <- &close;
|
||||
@@ -742,6 +746,12 @@ void Att::decode (std::string& value) const
|
||||
while ((i = value.find ("&tab;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 5, "\t");
|
||||
|
||||
while ((i = value.find ("&dquot;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 7, "\"");
|
||||
|
||||
while ((i = value.find ("&squot;")) != std::string::npos) // no i18n
|
||||
value.replace (i, 7, "'");
|
||||
|
||||
while ((i = value.find (""")) != std::string::npos) // no i18n
|
||||
value.replace (i, 6, "\"");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user