12 Commits

Author SHA1 Message Date
Benedikt Heine
9b45a111f1 Sort includes alphabetically 2018-11-15 15:17:48 +01:00
Benedikt Heine
2d2a9c893c Add doxygen docs for markup and utils files 2018-11-11 17:27:11 +01:00
Benedikt Heine
413c0d68af Use assertions and NULL checks in markup and utils 2018-11-11 17:26:14 +01:00
Nikos Tsipinakis
2c6cb8ebf3 Implement smarter markup escaping
Automatically detect and escape invalid and unsupported & entities.

Fixes #546
2018-11-06 20:49:47 +02:00
Sascha kruse
bf286f73cd remove unnecessary initialization of variable
The inizialization value is never used and is overriden
directly after.
2018-09-14 14:37:27 +02:00
Benedikt Heine
f4fb95c827 Do not make explicit NULL checks on elements
Most of the NULL checks are actually doubly false logic. Turning the
logic around and removing the NULL check makes the program easier to
read.
2018-07-10 13:23:12 +02:00
Benedikt Heine
19b364d67c Translate fprintf statements into log messages 2018-02-02 17:29:04 +01:00
Benedikt Heine
acd8be51ab Remove a and img tags from msg
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.
2017-12-15 00:16:31 +01:00
Benedikt Heine
be3636c679 Remove _GNU_SOURCE macro
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.
2017-10-08 02:32:37 +02:00
Luke Shumaker
1f77b28691 markup.c: markup_unquote(): Unquote things in the correct order
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, "&amp;lt;" should become "&lt;", but instead it becomes ">".
While this is unlikely to appear naturally in a notification, it is wrong.
2017-03-13 16:40:28 -04:00
Luke Shumaker
18c4b4bf7a markup.c: Tidy, expand comments
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.
2017-03-13 16:40:28 -04:00
Luke Shumaker
0c84e53afb Move markup handling into markup.{c,h}
This is strictly a code-organization change, and should contain no
functional changes.
2017-03-09 11:32:06 -05:00