Just recently, I started using g_return_val_if_fail as a brief assertion
checker. It'll also exit the function with a specified return value.
But actually this introduces some weird behavior. It's configurable by
environment variables and it'll print out a log message, if the
expression didn't validate properly. But some of these assertions are
actually ment to be silent.
Using a simple macro makes it simple to structure the assertions and its
return values in a block at the start of a function or anywhere else.
While the notification spec allows tags like <a href="...">...</a> and
<img src="..." alt="...">, pango cannot parse these tags and therefore
these tags should be removed before passed to pango.
Also the method notification_extract_markup_urls is not needed anymore,
as markup_strip_a can return URLs optionally.
This implies, that URL replacement is now indicated via show_indicators
for URLs and the dmenu string is in the format of
'[text between a tags] URL\n'. This is similarly handled for images,
too.
After some research, the _GNU_SOURCE does not affect any function call
anymore. To avoid future failures on other systems not using glibc,
_GNU_SOURCE gets removed.
Because "&" is not the last character to be unescaped, it is possible that
the lines for "<" and ">" expand some things they shouldn't.
For example, "&lt;" should become "<", but instead it becomes ">".
While this is unlikely to appear naturally in a notification, it is wrong.
This turns a hard-to-understand nested if{} chain into a simple switch
statement, and pulls some code out in to utility functions.
This is strictly a code-organization change, and should contain no
functional changes.