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:
duanwilliam 2022-03-28 18:23:03 -07:00 committed by GitHub
parent 37a5dfaccc
commit b5fc9a6b6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ const commentPatterns = {
js: {start: '\\/\\/', end: ''}, js: {start: '\\/\\/', end: ''},
jsBlock: {start: '\\/\\*', end: '\\*\\/'}, jsBlock: {start: '\\/\\*', end: '\\*\\/'},
jsx: {start: '\\{\\s*\\/\\*', end: '\\*\\/\\s*\\}'}, jsx: {start: '\\{\\s*\\/\\*', end: '\\*\\/\\s*\\}'},
python: {start: '#', end: ''}, bash: {start: '#', end: ''},
html: {start: '<!--', end: '-->'}, html: {start: '<!--', end: '-->'},
}; };
@ -59,11 +59,13 @@ function getAllMagicCommentDirectiveStyles(lang: string) {
case 'python': case 'python':
case 'py': case 'py':
return getCommentPattern(['python']); case 'bash':
return getCommentPattern(['bash']);
case 'markdown': case 'markdown':
case 'md': case 'md':
return getCommentPattern(['html', 'jsx']); // Text uses HTML, front matter uses bash
return getCommentPattern(['html', 'jsx', 'bash']);
default: default:
// all comment types // all comment types