Skip to content

Commit

Permalink
update a sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Marx committed Sep 17, 2024
1 parent 8b796b8 commit dc66702
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ public static String removeLeadingPipe(String s) {
}

public static String removeTrailingPipe(String s) {
return s.replaceAll("\\|+$", "");
return s.replaceAll("\\|++$", "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Match> parseShortcodes(String text) {
Expand Down

0 comments on commit dc66702

Please sign in to comment.