Skip to content

Commit

Permalink
bump 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
firm1 committed Feb 4, 2017
1 parent 75f20bc commit 875efbe
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -130,7 +130,7 @@ private void displayIndex(Map<String, Double> resultIndex, String title, String

@FXML private void handleFleshButtonAction(ActionEvent event){
Function<Textual, Double> 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;
Expand All @@ -154,7 +154,7 @@ private void displayIndex(Map<String, Double> resultIndex, String title, String

@FXML private void handleGunningButtonAction(ActionEvent event){
Function<Textual, Double> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -390,7 +390,7 @@ private void initContextMenu(ContentNode item) {
logger.debug("Tentative de calcul des statistiques de lisiblité");
Container container = (Container) getItem();
Function<Textual, Double> 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;
Expand All @@ -400,7 +400,7 @@ private void initContextMenu(ContentNode item) {
}
};
Function<Textual, Double> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/TestCorrect.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -22,36 +22,36 @@ public void testOrtho() {
String txt="<p>Ce text et plin 2 fotes lol.</p>";
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);
}

@Test
public void testEscapeCodeRejectIfNotInMarkup() {
String txt = "<p>Tapez sudo apt-get install vim</p>";
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt));
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt));
assertNotSame(result, txt);
}

@Test
public void testEscapeCodeAcceptIfInMarkup() {
String txt="<p>Tapez <code>sudo apt-get install vim</code></p>";
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt));
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt));
assertEquals(result, txt);
}

@Test
public void testEscapeCodeAcceptNotInMarkupButRejectWhenOut() {
String txt="<p>Tapez <code>sudo apt-get install vim</code> mon sudo est dehors</p>";
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeHtml(txt));
String result = corrector.checkHtmlContent(StringEscapeUtils.unescapeXml(txt));
assertNotSame(result, txt);
}

@Test
public void testEscapeItalic() {
String txt="<p>Est-ce que tu voudrais <em>pusher</em> ton code ?</p>";
String s = StringEscapeUtils.unescapeHtml(txt);
String s = StringEscapeUtils.unescapeXml(txt);
String result = corrector.checkHtmlContent(s);
assertEquals(result, txt);
}
Expand Down

0 comments on commit 875efbe

Please sign in to comment.