Skip to content

Commit

Permalink
修复 code 无法解析 html 标签
Browse files Browse the repository at this point in the history
  • Loading branch information
qianmoQ committed Dec 30, 2024
1 parent 699348e commit 7f6822f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 2 additions & 4 deletions docs/content/docs/support-syntax/tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ title: 选项卡

PageForge 支持使用 markdown 实现了选项卡相关信息。

::: danger
### 基本语法

:::

## 基本语法
---

```markdown
::: tabs
Expand Down
8 changes: 8 additions & 0 deletions docs/content/getting-started/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ templates
按照文件的路径,您可以覆盖默认的模板文件。

如果自定义模版,可以直接在 `templates/layouts` 文件夹中创建自定义的布局文件,文件名便是模版名称。

```
<article>
<div class="content">
<%- content %>
</div>
</article>
```
2 changes: 1 addition & 1 deletion lib/extension/marked/pageforge-code-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PageForgeCodeBlockExtension = {
type: 'pageforgeCodeBlock',
raw: match[0],
lang: match[1], // 语言标识
text: match[2], // 代码内容
text: match[2].replace(/</g, '&lt;').replace(/>/g, '&gt;'), // 转义特殊字符
tokens: []
};
}
Expand Down
2 changes: 1 addition & 1 deletion templates/includes/toc.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% items.forEach(item => { %>
<div class="pl-<%= (item.level - 1) * 4 %>">
<a href="#<%= item.slug %>"
class="block py-2 px-3 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition-colors duration-150 toc-link"
class="block px-3 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition-colors duration-150 toc-link"
data-slug="<%= item.slug %>">
<%- item.text %>
</a>
Expand Down

0 comments on commit 7f6822f

Please sign in to comment.