From 875efbedf5836d43701b5f31282542adec1dfe4c Mon Sep 17 00:00:00 2001 From: firm1 Date: Sat, 4 Feb 2017 18:38:57 +0100 Subject: [PATCH] bump 1.6.0 --- build.gradle | 4 ++-- gradle.properties | 2 +- .../zestwriter/utils/Configuration.java | 2 +- .../zestedesavoir/zestwriter/utils/Corrector.java | 4 ++-- .../zestwriter/view/MdTextController.java | 4 ++-- .../zestwriter/view/MenuController.java | 8 ++++---- .../zestwriter/view/com/MdTreeCell.java | 6 +++--- .../zestwriter/view/task/CorrectionService.java | 4 ++-- src/test/java/TestCorrect.java | 12 ++++++------ 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 523368c2d..4032727fe 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ javafx { // informations category = "Office" - copyright = "Copyright (c) 2016 Zest Writer" + copyright = "Copyright (c) 2016 - 2017 Zest Writer" description = "This is a Markdown Editor for Zeste de Savoir contents" licenseType = "GPLv3" vendor = "firm1" @@ -113,7 +113,7 @@ tasks.minifyCss.dependsOn tasks.processResources dependencies { testCompile 'junit:junit:4.12' - compile group: 'org.languagetool', name: 'language-fr', version: '3.5' + compile group: 'org.languagetool', name: 'language-fr', version: '3.6' compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.2' compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.2' compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.5' diff --git a/gradle.properties b/gradle.properties index 46532987e..17b4bb9a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=1.5.1 +version=1.6.0 javafx.releaseKey.keyPass=clementine javafx.releaseKey.storePass=clementine javafx.releaseKey.keyStore = keys/keystore.jks diff --git a/src/main/java/com/zestedesavoir/zestwriter/utils/Configuration.java b/src/main/java/com/zestedesavoir/zestwriter/utils/Configuration.java index 3c729db31..796d38858 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/utils/Configuration.java +++ b/src/main/java/com/zestedesavoir/zestwriter/utils/Configuration.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.zestedesavoir.zestwriter.MainApp; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.math.NumberUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.http.client.fluent.Request; import javax.swing.*; diff --git a/src/main/java/com/zestedesavoir/zestwriter/utils/Corrector.java b/src/main/java/com/zestedesavoir/zestwriter/utils/Corrector.java index 4d6815dcc..93e62644a 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/utils/Corrector.java +++ b/src/main/java/com/zestedesavoir/zestwriter/utils/Corrector.java @@ -3,7 +3,7 @@ import com.zestedesavoir.zestwriter.view.MdTextController; import com.zestedesavoir.zestwriter.view.MenuController; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.jsoup.Jsoup; import org.jsoup.examples.HtmlToPlainText; import org.languagetool.JLanguageTool; @@ -212,7 +212,7 @@ public String checkHtmlContentToText(String htmlContent, String source) { } public int countMistakes(MdTextController mdTextController, String markdown) { - String htmlText = StringEscapeUtils.unescapeHtml(MenuController.markdownToHtml(mdTextController, markdown)); + String htmlText = StringEscapeUtils.unescapeXml(MenuController.markdownToHtml(mdTextController, markdown)); AnnotatedText markup = makeAnnotatedText(htmlText); langTool.getAllActiveRules().stream() diff --git a/src/main/java/com/zestedesavoir/zestwriter/view/MdTextController.java b/src/main/java/com/zestedesavoir/zestwriter/view/MdTextController.java index 2ffc7e08c..0dde00bac 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/view/MdTextController.java +++ b/src/main/java/com/zestedesavoir/zestwriter/view/MdTextController.java @@ -38,7 +38,7 @@ import lombok.NoArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.fxmisc.wellbehaved.event.EventHandlerHelper; import org.python.core.PyString; import org.python.util.PythonInterpreter; @@ -807,7 +807,7 @@ public void addTreeSummary() { } @FXML private void handleValidateButtonAction(ActionEvent event) { - String s = StringEscapeUtils.unescapeHtml(markdownToHtml(currentSourceText.getText())); + String s = StringEscapeUtils.unescapeXml(markdownToHtml(currentSourceText.getText())); if(MdConvertController.corrector == null) { MdConvertController.corrector = new Corrector(); } diff --git a/src/main/java/com/zestedesavoir/zestwriter/view/MenuController.java b/src/main/java/com/zestedesavoir/zestwriter/view/MenuController.java index e5d3872d1..87f09a4c6 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/view/MenuController.java +++ b/src/main/java/com/zestedesavoir/zestwriter/view/MenuController.java @@ -41,8 +41,8 @@ import lombok.NoArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; import org.fxmisc.richtext.StyleClassedTextArea; import org.python.core.PyString; import org.python.util.PythonInterpreter; @@ -130,7 +130,7 @@ private void displayIndex(Map resultIndex, String title, String @FXML private void handleFleshButtonAction(ActionEvent event){ Function calFlesh = (Textual ch) -> { - String htmlText = StringEscapeUtils.unescapeHtml(markdownToHtml(mainApp.getIndex(), ch.readMarkdown())); + String htmlText = StringEscapeUtils.unescapeXml(markdownToHtml(mainApp.getIndex(), ch.readMarkdown())); String plainText = Corrector.htmlToTextWithoutCode(htmlText); if("".equals(plainText.trim())){ return 100.0; @@ -154,7 +154,7 @@ private void displayIndex(Map resultIndex, String title, String @FXML private void handleGunningButtonAction(ActionEvent event){ Function calGuning = (Textual ch) -> { - String htmlText = StringEscapeUtils.unescapeHtml(markdownToHtml(mainApp.getIndex(), ch.readMarkdown())); + String htmlText = StringEscapeUtils.unescapeXml(markdownToHtml(mainApp.getIndex(), ch.readMarkdown())); String plainText = Corrector.htmlToTextWithoutCode(htmlText); if("".equals(plainText.trim())){ return 100.0; diff --git a/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java b/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java index 261a5d9df..a9d3a9025 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java +++ b/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java @@ -15,7 +15,7 @@ import javafx.scene.control.*; import javafx.scene.control.Alert.AlertType; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -390,7 +390,7 @@ private void initContextMenu(ContentNode item) { logger.debug("Tentative de calcul des statistiques de lisiblité"); Container container = (Container) getItem(); Function performGuning = (Textual ch) -> { - String htmlText = StringEscapeUtils.unescapeHtml(MenuController.markdownToHtml(index, ch.readMarkdown())); + String htmlText = StringEscapeUtils.unescapeXml(MenuController.markdownToHtml(index, ch.readMarkdown())); String plainText = Corrector.htmlToTextWithoutCode(htmlText); if("".equals(plainText.trim())){ return 100.0; @@ -400,7 +400,7 @@ private void initContextMenu(ContentNode item) { } }; Function performFlesch = (Textual ch) -> { - String htmlText = StringEscapeUtils.unescapeHtml(MenuController.markdownToHtml(index, ch.readMarkdown())); + String htmlText = StringEscapeUtils.unescapeXml(MenuController.markdownToHtml(index, ch.readMarkdown())); String plainText = Corrector.htmlToTextWithoutCode(htmlText); if("".equals(plainText.trim())){ return 100.0; diff --git a/src/main/java/com/zestedesavoir/zestwriter/view/task/CorrectionService.java b/src/main/java/com/zestedesavoir/zestwriter/view/task/CorrectionService.java index e71073ba0..0244952ae 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/view/task/CorrectionService.java +++ b/src/main/java/com/zestedesavoir/zestwriter/view/task/CorrectionService.java @@ -9,7 +9,7 @@ import com.zestedesavoir.zestwriter.view.MenuController; import javafx.concurrent.Service; import javafx.concurrent.Task; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import java.util.Map; import java.util.Map.Entry; @@ -40,7 +40,7 @@ protected String call(){ MainApp.getLogger().debug("Jython en cours de chargement mémoire"); return null; } else { - String htmlText = StringEscapeUtils.unescapeHtml(MenuController.markdownToHtml(mdText, markdown)); + String htmlText = StringEscapeUtils.unescapeXml(MenuController.markdownToHtml(mdText, markdown)); return corrector.checkHtmlContentToText(htmlText, ext.getTitle()); } }; diff --git a/src/test/java/TestCorrect.java b/src/test/java/TestCorrect.java index 9d096d601..00a49d41c 100644 --- a/src/test/java/TestCorrect.java +++ b/src/test/java/TestCorrect.java @@ -1,6 +1,6 @@ import com.zestedesavoir.zestwriter.utils.Configuration; import com.zestedesavoir.zestwriter.utils.Corrector; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.junit.Before; import org.junit.Test; @@ -22,7 +22,7 @@ public void testOrtho() { String txt="

Ce text et plin 2 fotes lol.

"; int expectedError = 3; - String s = StringEscapeUtils.unescapeHtml(txt); + String s = StringEscapeUtils.unescapeXml(txt); String result = corrector.checkHtmlContent(s); assertEquals(result.split("error-french").length, expectedError+1); } @@ -30,28 +30,28 @@ public void testOrtho() { @Test public void testEscapeCodeRejectIfNotInMarkup() { String txt = "

Tapez sudo apt-get install vim

"; - String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt)); + String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt)); assertNotSame(result, txt); } @Test public void testEscapeCodeAcceptIfInMarkup() { String txt="

Tapez sudo apt-get install vim

"; - String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt)); + String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt)); assertEquals(result, txt); } @Test public void testEscapeCodeAcceptNotInMarkupButRejectWhenOut() { String txt="

Tapez sudo apt-get install vim mon sudo est dehors

"; - String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt)); + String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt)); assertNotSame(result, txt); } @Test public void testEscapeItalic() { String txt="

Est-ce que tu voudrais pusher ton code ?

"; - String s = StringEscapeUtils.unescapeHtml(txt); + String s = StringEscapeUtils.unescapeXml(txt); String result = corrector.checkHtmlContent(s); assertEquals(result, txt); }