Thanks for working on this, Cody.
+#define CHARACTER_LT_REGEX "&(lt;|#60;|#x3C;)"
This should be "&(lt;|#60;|#x3C;|#x3c;)"
+#define CHARACTER_GT_REGEX "&(gt;|#62;|#x3e;)"
This should be "&(gt;|#62;|#x3E;|#x3e;)"
+#define CHARACTER_APOS_REGEX "&(apos;|#39;|#x27;)"
+#define CHARACTER_QUOT_REGEX "&(quot;|#34;|#x22;)"
To repeat my question from yesterday: Why are you special-casing "
and '? The spec doesn't say to do that. (And why are you converting
" and ', but not (, ), *, +, etc?) Do you have
any evidence that applications escape " or ' when sending notifications?
If so, let me know, and I'll change the spec. If not, unescaped text
will work more often without those conversions.
+#define LINK_MATCH_REGEX
"<a[^>]*?href\\s*=\\s*[\"\"']?([^'\"\" >]+?)['\"\"]?>(.*?)</a>"
+#define LINK_REPLACE_REGEX
"<a[^>]*?href\\s*=\\s*[\"\"']?([^'\"\" >]+?)['\"\"]?>|</a>"
Why are you treating <a> elements separately from other elements? Again,
that doesn't match the algorithm I provided in the spec, and I don't see
any reason to do it. Please, either follow the spec or tell me why it
needs changing, don't do something undocumented.
+#define OTHER_MATCH_REGEX
"<([A-Z][A-Z0-9]*)\\b[^>]*>(.*?)</\\1>"
I'm not a regexp expert, but that "\1" looks like it's not following the
spec, which says to drop *any* sequence of characters that starts with
"</" and ends with ">", not just those where what's between them matches
a previous tag. Is your aim here to reduce unwanted tag-swallowing, on
the grounds that "foo</i>" malfunctions in notification-daemon anyway?
That could be nifty, though it would be harder to specify and implement
in a non-regexp way. (Unless, or maybe even if, the Desktop
Notifications Specification 1.0 totally redoes the body text format, the
guessing algorithm probably should be included in that spec for all
servers to implement.)
--
Character reference handling for <, &, and > doesn't match notification-daemon
https://bugs.launchpad.net/bugs/356659
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs