diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiDelimiterProcessor.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiDelimiterProcessor.java index 8869835d29..234773dadc 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiDelimiterProcessor.java +++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiDelimiterProcessor.java @@ -55,14 +55,14 @@ public void process(Delimiter opener, Delimiter closer, int delimitersUsed) { public boolean canBeOpener(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace) { - return leftFlanking; + return leftFlanking && (beforeIsPunctuation || beforeIsWhitespace); } @Override public boolean canBeCloser(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace) { - return rightFlanking; + return rightFlanking && (afterIsPunctuation || afterIsWhiteSpace); } @Override diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiExtension.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiExtension.java index 6753235f35..e4b745a9eb 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiExtension.java +++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/emoji/EmojiExtension.java @@ -8,12 +8,10 @@ public class EmojiExtension implements Parser.ParserExtension, HtmlRenderer.Html @Override public void rendererOptions(final MutableDataHolder options) { - } @Override public void parserOptions(final MutableDataHolder options) { - } @Override