Skip to content

Commit

Permalink
[output] Fix flagged REDOS regex
Browse files Browse the repository at this point in the history
Fix some of the regexes flagged by the eslint
REDOS plugin.

See #107
  • Loading branch information
larsgw committed May 11, 2018
1 parent b3266c3 commit fa7cb32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/get/modules/csl/affix.js
Expand Up @@ -14,7 +14,9 @@
*/
const getAffix = (source, affix) => typeof affix === 'function' ? affix(source) : typeof affix === 'string' ? affix : ''

const htmlRegex = /^(\s*<[a-z0-9:-]+(?:\s*[a-z0-9:-]+=(?:"(?:\\\\|\\"|[^"])*"|'(?:\\\\|\\'|[^'])*'|\w+))*\s*>)([\s\S]+)(<\/[a-z:]+>\s*)$/i
// This simplified Regex only fails when one of the attributes of the top-level
// element contains a right angle bracket (">").
const htmlRegex = /^([^>]+>)([\s\S]+)(<[^<]+)$/i

/**
* Pre/append things to entry
Expand Down

0 comments on commit fa7cb32

Please sign in to comment.