-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added fix for newline and updated tests #4111
base: main
Are you sure you want to change the base?
Conversation
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +3 B View Changes
|
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +7 B View Changes
|
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +3 B View Changes
|
// Optimized block scalar handling to avoid polynomial backtracking | ||
const BLOCK_SCALAR = { | ||
className: 'string', | ||
begin: /[|>][-+\d]*\s*$/, // Block scalar indicator with modifiers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the regex here around +-number is much fuzzier than the tighter one below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you referring to the regex on line 113 and 126 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to this looking much more correct:
'[\\|>]([-+]?[0-9]*)?[ ]*\\n'
ie, +- followed by digits, etc...
This regest would allow all sorts of -43+23423---13+++
...
{ // multi line string | ||
// Blocks start with a | or > followed by a newline | ||
// | ||
// Indentation of subsequent lines must be the same to | ||
// be considered part of the block | ||
className: 'string', | ||
begin: '[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*' | ||
begin: '[\\|>]([-+]?[0-9]*)?[ ]*\\n', // Support for block string indicators | ||
relevance: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have BLOCK_SCALAR which cases is this covering again?
Resolves #4090
before
after:
Checklist
CHANGES.md