about summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2020-08-11 14:58:57 +0200
committersternenseemann <sternenseemann@systemli.org>2020-08-11 14:58:57 +0200
commit6c51d03ca0b2acb182ae7d168178ba192476c2c7 (patch)
tree95f1b1ebd7addea5d1db32c88b6e6018e7ce5f58 /main.c
parent5e41e6e81915801da14d0ef582fb7376b77247b4 (diff)
feat(xml): add support for CDATA sections
* xml_open_cdata and xml_close_cdata add convenient support for this
* tracked on stack using the newly introduced field type which is of
  enum xml_tag_type which may either be XML_NORMAL_TAG or XML_CDATA.
* xml_close_all and xml_close_including also support closing CDATA
  sections now
* xml_close_including now behaves like xml_close_all if NULL is given
  as tag, xml_close_all newly aliased to xml_close_including(..., NULL)
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 6f29d10..4af412e 100644
--- a/main.c
+++ b/main.c
@@ -325,9 +325,9 @@ void blog_rss(char script_name[]) {
 
         if(entries[i].text_size > 0) {
             xml_open_tag(&ctx, "description");
-            xml_raw(&ctx, "<![CDATA[");
+            xml_open_cdata(&ctx);
             xml_raw(&ctx, entries[i].text);
-            xml_raw(&ctx, "]]>");
+            xml_close_cdata(&ctx);
             xml_close_tag(&ctx, "description");
         }