Skip to content
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

Fix TRIM_NEWLINES_AND_TRAILING_WHITESPACE_R regex bug #260

Merged
merged 1 commit into from
Aug 6, 2019
Merged

Fix TRIM_NEWLINES_AND_TRAILING_WHITESPACE_R regex bug #260

merged 1 commit into from
Aug 6, 2019

Conversation

mar4uk
Copy link
Contributor

@mar4uk mar4uk commented Aug 1, 2019

I found out if to pass to compiler string with consecutive \n in the middle of the text, then this replace doesn't work

`${input.replace(TRIM_NEWLINES_AND_TRAILING_WHITESPACE_R, '')}\n\n`,

There is an infinite loading. It happens only when the sequence of \n is longer than 25-30 symbols.

This bug was implemented in this commit bef82a5

I suppose that group inside the group in regex works very slow, that is why there is an infinite loading.

So in this PR I added the test of this case and simplified regex for TRIM_NEWLINES_AND_TRAILING_WHITESPACE_R

@codecov
Copy link

codecov bot commented Aug 1, 2019

Codecov Report

Merging #260 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #260   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files           1        1           
  Lines         367      367           
  Branches       59       59           
=======================================
  Hits          366      366           
  Misses          1        1
Impacted Files Coverage Δ
index.js 99.72% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d44703...9834971. Read the comment docs.

@quantizor
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants