diff --git a/mdit_py_plugins/amsmath/__init__.py b/mdit_py_plugins/amsmath/__init__.py
index b31d7ef..4359808 100644
--- a/mdit_py_plugins/amsmath/__init__.py
+++ b/mdit_py_plugins/amsmath/__init__.py
@@ -115,7 +115,4 @@ def amsmath_block(state: StateBlock, startLine: int, endLine: int, silent: bool)
def render_amsmath_block(self, tokens, idx, options, env):
token = tokens[idx]
- return (
- '\n\n'
- f"{escapeHtml(token.content)}\n\n\n"
- )
+ return f'
\n{escapeHtml(token.content)}\n
\n'
diff --git a/tests/fixtures/amsmath.md b/tests/fixtures/amsmath.md
index b023e60..ba21544 100644
--- a/tests/fixtures/amsmath.md
+++ b/tests/fixtures/amsmath.md
@@ -4,13 +4,11 @@ equation environment:
a = 1
\end{equation}
.
-
-
+
\begin{equation}
a = 1
\end{equation}
-
-
+
.
equation* environment:
@@ -19,13 +17,11 @@ equation* environment:
a = 1
\end{equation*}
.
-
-
+
\begin{equation*}
a = 1
\end{equation*}
-
-
+
.
multline environment:
@@ -34,13 +30,11 @@ multline environment:
a = 1
\end{multline}
.
-
-
+
\begin{multline}
a = 1
\end{multline}
-
-
+
.
multline* environment:
@@ -49,13 +43,11 @@ multline* environment:
a = 1
\end{multline*}
.
-
-
+
\begin{multline*}
a = 1
\end{multline*}
-
-
+
.
gather environment:
@@ -64,13 +56,11 @@ gather environment:
a = 1
\end{gather}
.
-
-
+
\begin{gather}
a = 1
\end{gather}
-
-
+
.
gather* environment:
@@ -79,13 +69,11 @@ gather* environment:
a = 1
\end{gather*}
.
-
-
+
\begin{gather*}
a = 1
\end{gather*}
-
-
+
.
align environment:
@@ -94,13 +82,11 @@ align environment:
a = 1
\end{align}
.
-
-
+
\begin{align}
a = 1
\end{align}
-
-
+
.
align* environment:
@@ -109,13 +95,11 @@ align* environment:
a = 1
\end{align*}
.
-
-
+
\begin{align*}
a = 1
\end{align*}
-
-
+
.
alignat environment:
@@ -124,13 +108,11 @@ alignat environment:
a = 1
\end{alignat}
.
-
-
+
\begin{alignat}
a = 1
\end{alignat}
-
-
+
.
alignat* environment:
@@ -139,13 +121,11 @@ alignat* environment:
a = 1
\end{alignat*}
.
-
-
+
\begin{alignat*}
a = 1
\end{alignat*}
-
-
+
.
flalign environment:
@@ -154,13 +134,11 @@ flalign environment:
a = 1
\end{flalign}
.
-
-
+
\begin{flalign}
a = 1
\end{flalign}
-
-
+
.
flalign* environment:
@@ -169,13 +147,11 @@ flalign* environment:
a = 1
\end{flalign*}
.
-
-
+
\begin{flalign*}
a = 1
\end{flalign*}
-
-
+
.
equation environment, with before/after paragraphs:
@@ -187,13 +163,11 @@ a = 1
after
.
before
-