summaryrefslogtreecommitdiff
path: root/localworddiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-04-21 17:02:44 +0200
committerJonas Smedegaard <dr@jones.dk>2013-04-21 17:02:44 +0200
commit5cd51c3109cc6581753adf15485797a98b0e7825 (patch)
tree5df5622fe9303c7faccd94ecae2366259c1f4bb2 /localworddiff
parentf1f328f207563e34c26f53b64b31f9fbfbc31296 (diff)
Pass each file div through markdown, and drop per-changed-chunk line-breaks.
Diffstat (limited to 'localworddiff')
-rwxr-xr-xlocalworddiff6
1 files changed, 1 insertions, 5 deletions
diff --git a/localworddiff b/localworddiff
index 0ff2f7a..4ee12d6 100755
--- a/localworddiff
+++ b/localworddiff
@@ -40,10 +40,6 @@ cat > "$3" <<EOF
float: left;
width: 49%;
}
-.file .hunk {
- float: right;
- width: 90%;
-}
.file .hunk del,
.file .hunk ins {
font-weight: bold;
@@ -60,7 +56,7 @@ cat > "$3" <<EOF
</head>
<body>
EOF
-perl -MText::WordDiff -E 'say word_diff "'"$1"'", "'"$2"'", { STYLE => "HTMLTwoLines" }' >> "$3"
+perl -MText::WordDiff -MText::Markdown=markdown -E '$d="<div class=\"file\">";$d_="<\/div>";foreach(split /(?:$d_\n)?$d/, word_diff "'"$1"'", "'"$2"'", { STYLE => "HTMLTwoLines" }){say $d.markdown($_).$d_ if ($_)}'>> "$3"
cat >> "$3" <<EOF
</body>
</html>