Skip to content

Commit

Permalink
code: support double ` inline codeblocks (#30)
Browse files Browse the repository at this point in the history
Added support for inline codeblocks that can be created with double \` (e.g. ``text``) which is supported by Discord desktop, Discord mobile should consume the same rules and the inline codeblock rule should not consume empty inline codeblocks.
  • Loading branch information
VoltrexKeyva authored Jul 28, 2021
1 parent 1c84600 commit b21dd83
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object CodeRules {
Pattern.compile("""^```(?:([\w+\-.]+?)?(\s*\n))?([^\n].*?)\n*```""", Pattern.DOTALL)

val PATTERN_CODE_INLINE: Pattern =
Pattern.compile("""^`([^`]*?)`""", Pattern.DOTALL)
Pattern.compile("""^`([^`]+)`|``([^`]+)``""", Pattern.DOTALL)

private const val CODE_BLOCK_LANGUAGE_GROUP = 1
private const val CODE_BLOCK_WS_PREFIX = 2
Expand Down

0 comments on commit b21dd83

Please sign in to comment.