mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-16 10:37:20 +02:00
fix(theme): add bash style to Markdown comment styles (#7049)
* docs: fix code block line highlighting in md syntax highlighting * properly fix Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
37a5dfaccc
commit
b5fc9a6b6d
1 changed files with 5 additions and 3 deletions
|
@ -15,7 +15,7 @@ const commentPatterns = {
|
|||
js: {start: '\\/\\/', end: ''},
|
||||
jsBlock: {start: '\\/\\*', end: '\\*\\/'},
|
||||
jsx: {start: '\\{\\s*\\/\\*', end: '\\*\\/\\s*\\}'},
|
||||
python: {start: '#', end: ''},
|
||||
bash: {start: '#', end: ''},
|
||||
html: {start: '<!--', end: '-->'},
|
||||
};
|
||||
|
||||
|
@ -59,11 +59,13 @@ function getAllMagicCommentDirectiveStyles(lang: string) {
|
|||
|
||||
case 'python':
|
||||
case 'py':
|
||||
return getCommentPattern(['python']);
|
||||
case 'bash':
|
||||
return getCommentPattern(['bash']);
|
||||
|
||||
case 'markdown':
|
||||
case 'md':
|
||||
return getCommentPattern(['html', 'jsx']);
|
||||
// Text uses HTML, front matter uses bash
|
||||
return getCommentPattern(['html', 'jsx', 'bash']);
|
||||
|
||||
default:
|
||||
// all comment types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue