Fix security related problems (#1522)

* Remove unnecessary capture group from regex

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Rename component to make name more expressive

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove redundant expression

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Filter vbscript links

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Remove superfluous parameter

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Check if handler is set

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Fix doc

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-10-01 22:51:57 +02:00 committed by GitHub
parent 0e512531a0
commit 87d6285da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 11 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'