X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=plugins%2Frss_feed.py;h=a8adbec8bb068ce3e7ddd29bdd1e02a14d1d0aad;hb=081d468ad899679ab2adcfd74ec47bd29a6d4486;hp=79fdae9fd5de6b22fddb31336c1c3d1f41afeea3;hpb=b15ac55039fe31a3e24e9ab4652c08486cd51dd5;p=webber.git diff --git a/plugins/rss_feed.py b/plugins/rss_feed.py index 79fdae9..a8adbec 100644 --- a/plugins/rss_feed.py +++ b/plugins/rss_feed.py @@ -1,6 +1,6 @@ # -*- coding: iso-8859-1 -*- from webber import * -import os, datetime +import os, datetime, re try: import PyRSS2Gen except ImportError: @@ -76,8 +76,10 @@ def finish(params): pass f = open(os.path.join(cfg.out_dir, cfg.rss_file), "w") # Ugly XML beautification - s = rss.to_xml().replace("<", "\n<").replace("\n\n", "\n")[1:] + s = rss.to_xml() + s = re.sub("<(?!/)", "\n<", s) + s = s.replace("\n\n", "\n") # Step two of self-reference s = s.replace('', '\n' % (cfg.main_url, cfg.rss_file)) - f.write(s) + f.write(s[1:]) f.write("\n")