diff --git a/mdit_py_plugins/myst_role/index.py b/mdit_py_plugins/myst_role/index.py
index 2d5577a..53ef60e 100644
--- a/mdit_py_plugins/myst_role/index.py
+++ b/mdit_py_plugins/myst_role/index.py
@@ -4,7 +4,7 @@
from markdown_it.common.utils import escapeHtml
from markdown_it.rules_inline import StateInline
-PATTERN = re.compile(r"^\{([a-zA-Z0-9\_\-\+\:]{1,36})\}(`+)(?!`)(.+?)(?'
- f"{{{name}}}[{escapeHtml(token.content)}]"
- ""
+ '' f"{{{name}}}[{escapeHtml(token.content)}]" "
"
)
diff --git a/tests/fixtures/myst_role.md b/tests/fixtures/myst_role.md
index c047193..4b2c248 100644
--- a/tests/fixtures/myst_role.md
+++ b/tests/fixtures/myst_role.md
@@ -3,14 +3,30 @@ Basic:
.
{abc}`xyz`
.
-
{abc}[xyz]
{abc}[xyz]
{abc}[xyz]
{def}[uvw]
a {abc}[xyz]
b
a {abc}[xyz]
b
{abc}[xy z]
d e
{abc}`xyz`
{name}`` a
+. Surrounding Code: . `a` {abc}`xyz` `b` . -a
{abc}[xyz]
b
a
{abc}[xyz]
b
{abc}[xyz]
{abc}[xyz]
-. @@ -50,7 +72,14 @@ Multiple ticks: . {abc}``xyz`` . -+
{abc}[xyz]
b
{abc}[xyz]
b
{abc}[xyz]
{abc}[xyz]
{abc}[x`yz]