mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 20:51:02 +01:00
fixed-newlines
This commit is contained in:
@@ -5,7 +5,15 @@ no strict "refs";
|
|||||||
|
|
||||||
use IO::All;
|
use IO::All;
|
||||||
use Encode;
|
use Encode;
|
||||||
use YAML::XS qw(Load Dump);
|
# only YAML::XS is able to properly load our data (others fail
|
||||||
|
# invariably)
|
||||||
|
use YAML::XS qw(Load);
|
||||||
|
# only YAML is able to properly Dump the data YAML::XS generates
|
||||||
|
# various kinds of multiline entries like "line\nline2\nline3" end up
|
||||||
|
# literally in the generated yaml, which note is then unable to
|
||||||
|
# feed. So, the pure perl version is better as it always generates
|
||||||
|
# multiline entries for data containing newlines
|
||||||
|
use YAML qw(Dump);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
my ($yf1, $yf2) = @ARGV;
|
my ($yf1, $yf2) = @ARGV;
|
||||||
@@ -27,6 +35,8 @@ my $hash2 = &hashify($y2);
|
|||||||
# diff and recombine the two into a new one
|
# diff and recombine the two into a new one
|
||||||
my $combinedhash = &hash2note(&diff($hash1, $hash2));
|
my $combinedhash = &hash2note(&diff($hash1, $hash2));
|
||||||
|
|
||||||
|
#print Dumper($combinedhash); exit;
|
||||||
|
|
||||||
# turn into yaml
|
# turn into yaml
|
||||||
my $combindedyaml = Dump($combinedhash);
|
my $combindedyaml = Dump($combinedhash);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user