Skip to content

Commit

Permalink
feat(plugin-markdown-hint): add injectStyles option
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Sep 20, 2024
1 parent 37b13ad commit 0e833ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/plugins/markdown/markdown-hint.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ The plugin also provides an `alert` option to support gfm alerts:
- Type: `boolean`
- Details: Whether enable gfm alert support.

### injectStyles

- Type: `boolean`
- Default: `true`
- Details: Whether to inject default styles.

### locales

- Type: `MarkdownHintPluginLocaleOptions`
Expand Down
6 changes: 6 additions & 0 deletions docs/zh/plugins/markdown/markdown-hint.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ const a = 1
- 类型:`boolean`
- 详情:是否启用 GFM 警告支持。

### injectStyles

- 类型:`boolean`
- 默认值:`true`
- 详情:是否注入默认样式。

### locales

- 类型:`MarkdownHintPluginLocaleOptions`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const markdownHintPlugin = (
if (options.hint !== false) md.use(hint, locale)
},

clientConfigFile: path.resolve(__dirname, '../client/config.js'),
clientConfigFile:
options.injectStyles === false
? undefined
: path.resolve(__dirname, '../client/config.js'),
}
}
7 changes: 7 additions & 0 deletions plugins/markdown/plugin-markdown-hint/src/node/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ export interface MarkdownHintPluginOptions {
*/
hint?: boolean

/**
* Whether to inject default styles
*
* @default true
*/
injectStyles?: boolean

/**
* Locale config
*
Expand Down

0 comments on commit 0e833ee

Please sign in to comment.