summaryrefslogtreecommitdiff
path: root/localsvgtidy
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-12-02 13:14:45 +0100
committerJonas Smedegaard <dr@jones.dk>2014-12-02 14:51:24 +0100
commita254bc38f2f49625ab9dffd1609f2f592581b76a (patch)
tree906767b7ade929e282a03c50f76c06d9e7c354e5 /localsvgtidy
parent8a3195b00ccd563fa492ea8a235a48a14f623b97 (diff)
Switch to "indented" style using TABs, and save memory by flushing at each tag.
Diffstat (limited to 'localsvgtidy')
-rwxr-xr-xlocalsvgtidy10
1 files changed, 7 insertions, 3 deletions
diff --git a/localsvgtidy b/localsvgtidy
index 81021b0..507994f 100755
--- a/localsvgtidy
+++ b/localsvgtidy
@@ -19,7 +19,6 @@
# Depends: libxml-twig-perl
#
# TODO: Apply (the equivalent of) python-scour
-# TODO: Use TAB for indentation
use warnings;
use strict;
@@ -29,8 +28,13 @@ use XML::Twig;
my $twig = XML::Twig->new(
keep_encoding => 1,
keep_atts_order => 1,
- pretty_print => 'cvs',
- );
+ pretty_print => 'indented',
+ twig_handlers => {
+ _all_ => sub { $_[0]->flush; },
+ }
+);
+
+$twig->set_indent("\t");
if ( my $file= $ARGV[0] ) {
$twig->parsefile( $file);