Skip to content

Commit 373b9d8

Browse files
authored
Merge pull request from GHSA-7wwv-vh3v-89cq
* enh(tests) analyze regex for catastrophic backtracking * allow testing individual languages * fix(routeros) resolve potential exponential backtracking issue * fix(powershell) resolve potential exponential backtracking issue * fix(erlang-repl) resolve backtracking issue * fix(r) resolve backtracking issue * fix(jboss-cli) resolve backtracking issue * (lint) perl * fix(perl) resolve exponential backtracking issue * fix(gams) resolve exponential backtracking issue * (lint) c-like * fix(handlebars) resolve exponential backtracking issue * fix(cpp) resolve exponential backtracking issue * fix(sqf) fix poly backtracking issue - The `_` case should already be handled by `_+` * fix(xquery) fix poly backtracking issue * fix(ruleslanguage) fix poly backtracking issue The extra expression here does not matter since it was purely optional (`*`). The important thing is gobbling up the `#` to prevent it from stealing relevance. And `\s+` gets that done on it's own. * fix(markdown) fix poly backtracking issue - Fix poly backtracking with code blocks * fix(dsconfig) fix poly backtracking issue Not 100% sure what the original intent of \S was since it seems that valueless properties wouldn't have a trailing `:` and why should we include the letter after as part of the match? That means that now there is an edge case that we handle slightly differently property:"quoted value" The `:` will not be highlighted (as it was before). This is a problem for another day when someone who knows about dsconfig shows up. * fix(x86asm) fix poly backtracking issue * fix(yaml) fix poly backtracking issue * fix(livecodeserver) fix poly backtracking issue * fix(fortran) fix poly backtracking issue * fix(fortran/irpf90) fix poly backtracking issue * fix(ruby) fix poly backtracking issues - Fix poly backtracking issue with RVM_PROMPT. - Fix poly backtracking issue with heredocs. * fix(ebnf) fix poly backtracking issue * fix(basic) fix poly backtracking issue * fix(elixir) fix poly backtracking issue * fix(crystal) fix poly backtracking issue * fix(scilab) fix poly backtracking issue * fix(csharp) fix poly backtracking issue * fix(coffee/livescript) fix poly backtracking issue - Fix issue with optional params for anonymous functions * fix(moonscript) fix poly backtracking issue * fix(aspectj) fix poly backtracking issue * fix(d) fix poly backtracking issue * fix(gcode) fix poly backtracking issue * fix(kotlin) fix poly backtracking issue No explanation for what this `illegal` is trying to accomplish to without that data, just remove it. * fix(kotlin) fix poly backtracking issue - Use same numeric mode rules as for Java * fix(asciidoc) fix poly backtracking issue * fix(javascript/typescript) fix poly backtracking issue - Fix poly backtracking issue in gnarly `()` counting regex * fix(latex) fix poly backtracking issue * fix(reasonml) fix poly backtracking issue - fix typo/bug with using `s` vs `\s` (string vs regex mistake) - simply `[pattern]?[pattern]?` to just `[pattern]{0,2}` - fix ambiguous `\s*` poly issues * enh(ci): Add tests for polynomial regex issues
1 parent 6a0c9f8 commit 373b9d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1034
-235
lines changed

CHANGES.md

+47
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,53 @@ Grammar improvements:
2929
[tripleee]: https://github.com/tripleee
3030

3131

32+
## Version 10.4.1 (tentative)
33+
34+
Security
35+
36+
- (fix) Exponential backtracking fixes for: [Josh Goebel][]
37+
- cpp
38+
- handlebars
39+
- gams
40+
- perl
41+
- jboss-cli
42+
- r
43+
- erlang-repl
44+
- powershell
45+
- routeros
46+
- (fix) Polynomial backtracking fixes for: [Josh Goebel][]
47+
- asciidoc
48+
- reasonml
49+
- latex
50+
- kotlin
51+
- gcode
52+
- d
53+
- aspectj
54+
- moonscript
55+
- coffeescript/livescript
56+
- csharp
57+
- scilab
58+
- crystal
59+
- elixir
60+
- basic
61+
- ebnf
62+
- ruby
63+
- fortran/irpf90
64+
- livecodeserver
65+
- yaml
66+
- x86asm
67+
- dsconfig
68+
- markdown
69+
- ruleslanguage
70+
- xquery
71+
- sqf
72+
73+
Very grateful to [Michael Schmidt][] for all the help.
74+
75+
[Michael Schmidt]: https://github.com/RunDevelopment
76+
[Josh Goebel]: https://github.com/joshgoebel
77+
78+
3279
## Version 10.4.0
3380

3481
A largish release with many improvements and fixes from quite a few different contributors. Enjoy!

package-lock.json

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"jsdom": "^16.4.0",
6565
"lodash": "^4.17.20",
6666
"mocha": "^8.2.1",
67+
"refa": "^0.4.1",
6768
"rollup": "^2.33.1",
6869
"should": "^13.2.3",
6970
"terser": "^5.3.8",

src/languages/asciidoc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default function(hljs) {
172172
},
173173
// images and links
174174
{
175-
begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]',
175+
begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]',
176176
returnBegin: true,
177177
contains: [
178178
{

src/languages/aspectj.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default function(hljs) {
115115
{
116116
// the function class is a bit different for AspectJ compared to the Java language
117117
className: 'function',
118-
begin: /\w+ +\w+(\.)?\w+\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,
118+
begin: /\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,
119119
returnBegin: true,
120120
end: /[{;=]/,
121121
keywords: KEYWORDS,

src/languages/basic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function(hljs) {
4545
{
4646
// Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
4747
className: 'number',
48-
begin: '\\b([0-9]+[0-9edED\.]*[#\!]?)',
48+
begin: '\\b\\d+(\\.\\d+)?([edED]\\d+)?[#\!]?',
4949
relevance: 0
5050
},
5151
{

0 commit comments

Comments
 (0)