Skip to content
Browse files
  • Loading branch information
da2x committed Sep 29, 2015
1 parent a2c2084 commit fd08864c0a109b96e595d6c775e72179719f824c
Showing with 2 additions and 0 deletions.
  1. +2 −0 nikola/
@@ -315,13 +315,15 @@ def jsonminify(data):
data = json.dumps(json.loads(data), indent=None, separators=(',', ':'))
return data

def xmlminify(data):
"""Minify XML files (strip whitespace and use minimal separators)."""
parser = lxml.etree.XMLParser(remove_blank_text=True)
newdata = lxml.etree.XML(data, parser=parser)
return lxml.etree.tostring(newdata, encoding='utf-8', method='xml', xml_declaration=True)

def _normalize_html(data):
"""Pass HTML through LXML to clean it up, if possible."""

0 comments on commit fd08864

Please sign in to comment.