Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 可保留引用块中的空行 #130

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@
10. 允许设定是否强制页脚在页面最底部
11. 允许关闭页面底部菜单
12. 允许添加内容到页脚最底部
13. 允许在引用块前添加引号(引用块在 Markdown 中使用 > 表示)
14. 允许在引用块后添加引号(引用块在 Markdown 中使用 > 表示)
13. 允许保留引用块中的空行
14. 允许在引用块前添加引号(引用块在 Markdown 中使用 > 表示)
15. 允许在引用块后添加引号(引用块在 Markdown 中使用 > 表示)

#### 增加于“首页样式”

Expand Down
10 changes: 10 additions & 0 deletions i18n-settings/settings.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,16 @@ spec:
label: Footer content at the bottom (support html code block)
language: html
height: 150px
- $formkit: radio
name: is_preserve_empty_lines_in_blockquote
label: Preserve empty lines in blockquote
value: true
options:
- label: Enable
value: true
- label: Disable
value: false
help: "If enabled, empty lines in blockquotes will be preserved; otherwise, they will be automatically removed. Blockquotes are represented by the > symbol in Markdown."
- $formkit: radio
name: is_show_the_quote_before_blockquote
label: Show the quote before Blockquote
Expand Down
10 changes: 10 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,16 @@ spec:
label: 页脚最底部内容(支持 html 代码块)
language: html
height: 150px
- $formkit: radio
name: is_preserve_empty_lines_in_blockquote
label: 引用块保留空行
value: true
options:
- label: 开启
value: true
- label: 关闭
value: false
help: 如启用此项,将在保留引用块中的空行,否则将自动删除引用块中的空行。引用块在 Markdown 中使用 > 表示。
- $formkit: radio
name: is_show_the_quote_before_blockquote
label: 引用块前添加引号
Expand Down
15 changes: 15 additions & 0 deletions templates/fragments/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,21 @@
/*[(${theme.config?.styles?.content_width_style})]*/ fit-content;
}
</style>
<style th:if="${theme.config?.styles?.is_preserve_empty_lines_in_blockquote}">
article .content blockquote p {
margin: inherit;
margin-left: 0;
margin-right: 0;
}

article .content blockquote p:first-child {
margin-top: 0;
}

article .content blockquote p:last-child {
margin-bottom: 0;
}
</style>
<style th:inline="css" th:if="${theme.config?.styles?.is_show_the_quote_before_blockquote}">
article .content blockquote:before {
margin-right: 0.25em;
Expand Down
Loading