fix: raw shortcode content rendering in another shortcode

This commit is contained in:
Dillon
2022-05-07 01:20:39 +08:00
parent eb924ead82
commit 28bc034af0
5 changed files with 164 additions and 96 deletions

View File

@@ -267,6 +267,31 @@ therefore, additional escape character expressions are required for these places
* `\[` -> `\\[`
* `\]` -> `\\]`
* `\\` -> `\\\\`
**LoveIt** theme supports `raw` shortcode to avoid these escape characters,
which helps you write raw mathematical formula content.
Example `raw` input:
```markdown
Inline Formula: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}}
Block Formula:
{{</* raw */>}}
\[ a=b+c \\ d+e=f \]
{{</* /raw */>}}
```
The rendered output looks like this:
Inline Formula: {{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{< /raw >}}
Block Formula:
{{< raw>}}
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
{{< /admonition >}}
#### Inline Formula

View File

@@ -265,6 +265,31 @@ resources:
* `\[` -> `\\[`
* `\]` -> `\\]`
* `\\` -> `\\\\`
**LoveIt** 主题支持 `raw` shortcode 以避免这些转义字符,
它可以帮助您编写原始数学公式内容.
一个 `raw` 示例:
```markdown
行内公式: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}}
公式块:
{{</* raw */>}}
\[ a=b+c \\ d+e=f \]
{{</* /raw */>}}
```
呈现的输出效果如下:
行内公式: {{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{< /raw >}}
公式块:
{{< raw>}}
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
{{< /admonition >}}
#### 行内公式