]> git.draconx.ca Git - homepage.git/commit
Work around Nokogiri pretty-print issues.
authorNick Bowler <nbowler@draconx.ca>
Wed, 9 Jan 2019 01:23:36 +0000 (20:23 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 9 Jan 2019 01:28:54 +0000 (20:28 -0500)
commit825315fbb0673eedb0963d76878f3ea91f18e255
treecc50b96823494ff50149ee21e021f4084d15cea4
parentda4a13ce4868f32787813c76898cc9b39dec1bcc
Work around Nokogiri pretty-print issues.

In general, pretty-printing XHTML will change its meaning because
whitespace added or removed can affect the results.  Instead of using
the xsl:strip-space functionality which is quite limited, use a normal
template to remove unwanted whitespace-only text nodes which can be
manually tweaked as required.

Then we explicitly add dummy nodes to prevent Nokogiri from reindenting
problematic cases, and finally clean those out just before publishing
(after all XSLT processing is finished).
Rules
layouts/default.xsl
layouts/functions.xsl [new file with mode: 0644]
lib/removewj.rb [new file with mode: 0644]