Fix regex DoS (#1533)

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-10-07 21:18:51 +02:00 committed by GitHub
parent 6adb63967b
commit f937dc6962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ import { Logger } from '../../../../utils/logger'
type highlightJsImport = typeof import('../../../common/hljs/hljs')
const log = new Logger('Autocompletion > CodeBlock')
const wordRegExp = /^```((?:\w|-|_|\+)*)$/
const wordRegExp = /^```((?:\w|-|\+)*)$/
let allSupportedLanguages: string[] = []
/**

View file

@ -8,7 +8,7 @@ import { Editor, Hint, Hints, Pos } from 'codemirror'
import { validAlertLevels } from '../../../markdown-renderer/markdown-it-plugins/alert-container'
import { findWordAtCursor, Hinter } from './index'
const wordRegExp = /^:::((?:\w|-|_|\+)*)$/
const wordRegExp = /^:::((?:\w|-|\+)*)$/
const spoilerSuggestion: Hint = {
text: ':::spoiler Toggle label\nToggled content\n::: \n',
displayText: 'spoiler'