diff --git a/.run/BaywatchApplication.run.xml b/.run/BaywatchApplication.run.xml
index f1c895e6..9140d519 100644
--- a/.run/BaywatchApplication.run.xml
+++ b/.run/BaywatchApplication.run.xml
@@ -8,6 +8,7 @@
+
diff --git a/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilter.java b/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilter.java
index 7d85360f..31fc9018 100644
--- a/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilter.java
+++ b/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilter.java
@@ -21,7 +21,7 @@
@Slf4j
public class SanitizerFilter implements NewsFilter, FeedsFilter {
private static final int PLAIN_TEXT_MAX_LENGTH = 250;
- private static final int HTML_MAX_LENGTH = 3_000;
+ private static final int HTML_MAX_LENGTH = 1_000;
private static final Function TITLE_POLICY =
new HtmlPolicyBuilder().toFactory();
@@ -50,7 +50,8 @@ private static String sanitizeHtml(final String html) {
String htmlEllipsed = html.substring(0, Math.min(HTML_MAX_LENGTH, html.length()));
StringBuilder htmlBuilder = new StringBuilder();
- HtmlStreamRenderer htmlRenderer = HtmlStreamRenderer.create(htmlBuilder, invalid -> log.trace("Invalid tag detected in description {}", invalid));
+ HtmlStreamRenderer htmlRenderer = HtmlStreamRenderer.create(htmlBuilder, invalid ->
+ log.atTrace().addArgument(invalid).setMessage("Invalid tag detected in description {}").log());
HtmlSanitizer.sanitize(HtmlUtils.htmlUnescape(htmlEllipsed), DESCRIPTION_POLICY.apply(htmlRenderer));
String saneHtml = htmlBuilder.toString();
@@ -64,7 +65,8 @@ private static String sanitizePlainText(final String text) {
String txtEllipsed = text.substring(0, Math.min(PLAIN_TEXT_MAX_LENGTH, text.length()));
StringBuilder txtBuilder = new StringBuilder();
- HtmlStreamRenderer txtRenderer = HtmlStreamRenderer.create(txtBuilder, invalid -> log.trace("Invalid tag detected in title {}", invalid));
+ HtmlStreamRenderer txtRenderer = HtmlStreamRenderer.create(txtBuilder, invalid ->
+ log.atTrace().setMessage("Invalid tag detected in title {}").addArgument(invalid).log());
HtmlSanitizer.sanitize(HtmlUtils.htmlUnescape(txtEllipsed), TITLE_POLICY.apply(txtRenderer));
String saneText = txtBuilder.toString();
diff --git a/sandside/src/main/resources/application.yaml b/sandside/src/main/resources/application.yaml
index 47490b93..e4d1eb1e 100644
--- a/sandside/src/main/resources/application.yaml
+++ b/sandside/src/main/resources/application.yaml
@@ -32,7 +32,6 @@ management:
application: ${spring.application.name}
logging:
- # pattern.level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
# Avoid infinite stacktrace due to reactor
exception-conversion-word: "%wEx{full, reactor.core.publisher}"
level:
diff --git a/sandside/src/test/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilterTest.java b/sandside/src/test/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilterTest.java
index 665b385e..487dc3f1 100644
--- a/sandside/src/test/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilterTest.java
+++ b/sandside/src/test/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/SanitizerFilterTest.java
@@ -51,7 +51,7 @@ void should_sanitize_news_description() {
"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in " +
"culpa qui officia deserunt mollit anim id est laborum. " +
"Illegal H1 usageIllegal A usageLorem ipsum dolor")
- .endsWith("quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irur"))
+ .endsWith("sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, co"))
.verifyComplete();
}
}
\ No newline at end of file