From 67e9a06e496d2c11432e4356c71e0af5a9204b16 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 10 Apr 2018 10:08:34 +0200 Subject: [PATCH] justify tool: accepts \r\n text --- src/be/nikiroo/utils/main/justify.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/utils/main/justify.java b/src/be/nikiroo/utils/main/justify.java index cf589059..32cfb103 100644 --- a/src/be/nikiroo/utils/main/justify.java +++ b/src/be/nikiroo/utils/main/justify.java @@ -38,7 +38,7 @@ public class justify { // TODO: move to utils? List lines = new ArrayList(); Scanner scan = new Scanner(System.in); - scan.useDelimiter("[\r\n]"); + scan.useDelimiter("\r\n|[\r\n]"); try { StringBuilder previous = null; StringBuilder tmp = new StringBuilder(); @@ -90,6 +90,7 @@ public class justify { return line.length() == 0 // || line.charAt(line.length() - 1) == '.' || line.charAt(line.length() - 1) == '"' - || line.charAt(line.length() - 1) == '»'; + || line.charAt(line.length() - 1) == '»' + ; } } -- 2.27.0