Skip to content

Commit

Permalink
fix: enable escaping on TableCell
Browse files Browse the repository at this point in the history
working on #295
  • Loading branch information
bsorrentino committed Oct 12, 2023
1 parent a65b74a commit ee97f60
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.regex.Pattern;

import static java.lang.String.format;
import static java.util.Optional.of;
import static java.util.Optional.ofNullable;
import static org.bsc.markdown.MarkdownVisitorHelper.*;

Expand Down Expand Up @@ -91,8 +90,14 @@ private boolean isParentRoot(Node node) {
* @return
*/
public static String escapeMarkdownText( Node node, String text ) {
if( node!=null && node.getParent() instanceof TableCell) return text;
return MarkdownVisitorHelper.escapeMarkdownText(text);

if( node!=null && node.getParent() instanceof TableCell ) {
return MarkdownVisitorHelper.escapeMarkdownText(text, EscapeTextEnum.LeftCurlyBrace);
}
return MarkdownVisitorHelper.escapeMarkdownText(text, EscapeTextEnum.LeftCurlyBrace,
EscapeTextEnum.LeftSquareBrace,
EscapeTextEnum.RightCurlyBrace,
EscapeTextEnum.RightSquareBrace);
}

private final static Pattern isHTMLCommentPattern = Pattern.compile( "^([\\s]*)<!--(?:[\\s]*)(.+)-->$", Pattern.DOTALL );
Expand Down

0 comments on commit ee97f60

Please sign in to comment.