2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

FIX: bbcode regex was greedy and preventing quotes

This commit is contained in:
Joffrey JAFFEUX 2018-05-23 11:55:02 +02:00 committed by GitHub
parent fac4bf2f85
commit dd76ba90b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -11,7 +11,7 @@ function trailingSpaceOnly(src, start, max) {
return true;
}
const ATTR_REGEX = /^\s*=(.+)$|((([a-z0-9]*)\s*)=)(["“”'].*["“”']|\S+)/ig;
const ATTR_REGEX = /^\s*=(.+)$|((([a-z0-9]*)\s*)=)(["“”'].*?["“”']|\S+)/ig;
// parse a tag [test a=1 b=2] to a data structure
// {tag: "test", attrs={a: "1", b: "2"}