This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 50f376122bf3265e99c9f5d1629c34c035871825 Author: juanpablo <juanpa...@apache.org> AuthorDate: Wed Oct 14 19:45:16 2020 +0200 JSPWIKI-1114: Preview parameter cutting now only at newlines, patch suggested by Ulf Dittmer - thanks! --- .../src/main/java/org/apache/wiki/plugin/WeblogPlugin.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jspwiki-main/src/main/java/org/apache/wiki/plugin/WeblogPlugin.java b/jspwiki-main/src/main/java/org/apache/wiki/plugin/WeblogPlugin.java index 397e6ce..148b4f8 100644 --- a/jspwiki-main/src/main/java/org/apache/wiki/plugin/WeblogPlugin.java +++ b/jspwiki-main/src/main/java/org/apache/wiki/plugin/WeblogPlugin.java @@ -311,7 +311,7 @@ public class WeblogPlugin implements Plugin, ParserStagePlugin { if (preview > 0) { // // We start with the first 'preview' number of characters from the text, - // and then add characters to it until we get to a linebreak or a period. + // and then add characters to it until we get to a linebreak. // The idea is that cutting off at a linebreak is less likely // to disturb the HTML and leave us with garbled output. // @@ -321,11 +321,6 @@ public class WeblogPlugin implements Plugin, ParserStagePlugin { if (html.charAt(cutoff) == '\r' || html.charAt(cutoff) == '\n') { hasBeenCutOff = true; break; - } else if (html.charAt(cutoff) == '.') { - // we do want the period - cutoff++; - hasBeenCutOff = true; - break; } cutoff++; } @@ -353,7 +348,7 @@ public class WeblogPlugin implements Plugin, ParserStagePlugin { author = "AnonymousCoward"; } - buffer.append( MessageFormat.format( rb.getString("weblogentryplugin.postedby"), author)); + buffer.append( MessageFormat.format( rb.getString( "weblogentryplugin.postedby" ), author ) ); buffer.append( "<a href=\"" + entryCtx.getURL( ContextEnum.PAGE_VIEW.getRequestContext(), entry.getName() ) + "\">" + rb.getString("weblogentryplugin.permalink") + "</a>" ); final String commentPageName = TextUtil.replaceString( entry.getName(), "blogentry", "comments" );