Skip to content

Commit

Permalink
feat(custom-container): add div container
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Nov 21, 2023
1 parent e253f29 commit 8ff74fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion help/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ Support functions similiar to [VuePress Container Block](https://v2.vuepress.vue

`type` is required, `title` and `content` are optional.

The supported `types` are: `tip` `warning` `danger` `details` `group` `group-item`
The supported `types` are: tip, warning, danger, details, group, group-item, row, col, section, div

**Example**

Expand Down
2 changes: 1 addition & 1 deletion help/FEATURES_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ chart.setOption(option, true)

`type` 是必需的, `title``content` 是可选的。

支持的 `type` 有:`tip` `warning` `danger` `details` `group` `group-item`
支持的 `type` 有:tip, warning, danger, details, group, group-item, row, col, section, div

**示例**

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/plugins/markdown-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default {
})

ctx.markdown.registerPlugin(md => {
['tip', 'warning', 'danger', 'details', 'group-item', 'group', 'row', 'col', 'section'].forEach(name => {
['tip', 'warning', 'danger', 'details', 'group-item', 'group', 'row', 'col', 'section', 'div'].forEach(name => {
const reg = new RegExp(`^${name}\\s*(.*)$`)

md.use(MarkdownItContainer, name, {
Expand Down Expand Up @@ -322,7 +322,7 @@ export default {
/* eslint-disable no-template-curly-in-string */

items.push(
{ label: '/ ::: Container', insertText: '${3|:::,::::,:::::|} ${1|tip,warning,danger,details,group,group-item,row,col,section|} ${2:Title}\n${4:Content}\n${3|:::,::::,:::::|}\n' },
{ label: '/ ::: Container', insertText: '${3|:::,::::,:::::|} ${1|tip,warning,danger,details,group,group-item,row,col,section,div|} ${2:Title}\n${4:Content}\n${3|:::,::::,:::::|}\n' },
{ label: '/ ::: Group Container', insertText: ':::: group ${1:Title}\n::: group-item Tab 1\ntest 1\n:::\n::: group-item *Tab 2\ntest 2\n:::\n::: group-item Tab 3\ntest 3\n:::\n::::\n' },
{ label: '/ ::: Column Container', insertText: ':::: row ${1:Title}\n::: col\ntest 1\n:::\n::: col\ntest 2\n:::\n::::\n' },
)
Expand Down

0 comments on commit 8ff74fd

Please sign in to comment.