From 879320262283b03e9b152c857a3b36b3032e4f73 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Sat, 13 Mar 2021 14:34:24 +0100 Subject: [PATCH] Fixed cleaning source. --- .../blockbookbinder/control/source/CleanSourceAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/nl/andrewlalis/blockbookbinder/control/source/CleanSourceAction.java b/src/main/java/nl/andrewlalis/blockbookbinder/control/source/CleanSourceAction.java index cac31ba..4ff5c25 100644 --- a/src/main/java/nl/andrewlalis/blockbookbinder/control/source/CleanSourceAction.java +++ b/src/main/java/nl/andrewlalis/blockbookbinder/control/source/CleanSourceAction.java @@ -24,7 +24,8 @@ public class CleanSourceAction extends AbstractAction { final String source = this.sourceTextPanel.getSourceText(); String updated = source.trim() .replaceAll("(?>\\v)+(\\v)", "\n\n") // Replace large chunks of newline with just two. - .replace(" ", " "); // Remove any double spaces. + .replaceAll("\\t", " ") // Replace tabs with single-spaces, for space savings. + .replaceAll(" +", " "); // Remove any double spaces. updated = this.removeNewlineWrapping(updated); this.sourceTextPanel.setSourceText(updated); }