diff --git a/cms-content/src/main/java/com/condation/cms/content/markdown/rules/inline/NewlineInlineRule.java b/cms-content/src/main/java/com/condation/cms/content/markdown/rules/inline/NewlineInlineRule.java index d4183805..d968227d 100644 --- a/cms-content/src/main/java/com/condation/cms/content/markdown/rules/inline/NewlineInlineRule.java +++ b/cms-content/src/main/java/com/condation/cms/content/markdown/rules/inline/NewlineInlineRule.java @@ -33,7 +33,7 @@ */ public class NewlineInlineRule implements InlineElementRule { - private static final Pattern PATTERN = Pattern.compile(" {2,}$", Pattern.MULTILINE); + private static final Pattern PATTERN = Pattern.compile(" {2,}+$", Pattern.MULTILINE); @Override public InlineBlock next(String md) { diff --git a/cms-content/src/main/java/com/condation/cms/content/markdown/utils/StringUtils.java b/cms-content/src/main/java/com/condation/cms/content/markdown/utils/StringUtils.java index 15b81244..2c3a10e1 100644 --- a/cms-content/src/main/java/com/condation/cms/content/markdown/utils/StringUtils.java +++ b/cms-content/src/main/java/com/condation/cms/content/markdown/utils/StringUtils.java @@ -72,6 +72,6 @@ public static String removeLeadingPipe(String s) { } public static String removeTrailingPipe(String s) { - return s.replaceAll("\\|+$", ""); + return s.replaceAll("\\|++$", ""); } } diff --git a/cms-content/src/main/java/com/condation/cms/content/shortcodes/ShortCodeParser.java b/cms-content/src/main/java/com/condation/cms/content/shortcodes/ShortCodeParser.java index cfb411e9..fd4604ca 100644 --- a/cms-content/src/main/java/com/condation/cms/content/shortcodes/ShortCodeParser.java +++ b/cms-content/src/main/java/com/condation/cms/content/shortcodes/ShortCodeParser.java @@ -33,8 +33,14 @@ @Slf4j public class ShortCodeParser { + /* private static final String SHORTCODE_REGEX = "\\[\\[(\\w+)([^\\]]*)\\]\\](.*?)\\[\\[\\/\\1\\]\\]|\\[\\[(\\w+)([^\\]]*)\\/\\]\\]"; private static final Pattern SHORTCODE_PATTERN = Pattern.compile(SHORTCODE_REGEX, Pattern.DOTALL); + */ + private static final String SHORTCODE_REGEX = "\\[\\[(\\w+)([^\\]]*)\\]\\](.*?)\\[\\[\\/\\1\\]\\]|\\[\\[(\\w+)([^\\]]*)\\s*\\/\\]\\]"; + private static final Pattern SHORTCODE_PATTERN = Pattern.compile(SHORTCODE_REGEX, Pattern.DOTALL); + + private static final Pattern PARAM_PATTERN = Pattern.compile("(\\w+)=(\"[^\"]*\"|'[^']*')"); public static List parseShortcodes(String text) {