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

Support backslash escaping, retain exact newline escaping #3638

Merged
merged 1 commit into from Jun 17, 2020

Conversation

guybedford
Copy link
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This adds backslash escaping as well to the recent escaping work.

I've also reverted to the direct newline escaping over the table approach here, but we can add back the table too if you prefer.

I've also added an extra check in the escaping function to avoid any replacement if escaping is unnecessary. This is a super minor mostly theoretical pref improvement to avoid copying strings.

@rollup-bot
Copy link
Collaborator

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#escaping-fixes

or load it into the REPL:
https://rollupjs.org/repl/?circleci=11964

@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #3638 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3638   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         183      183           
  Lines        6244     6246    +2     
  Branches     1830     1831    +1     
=======================================
+ Hits         6028     6030    +2     
  Misses        107      107           
  Partials      109      109           
Impacted Files Coverage Δ
src/utils/escapeId.ts 100.00% <100.00%> (ø)

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 08a6255...2a39a1d. Read the comment docs.

@lukastaegert lukastaegert merged commit 6d977a3 into master Jun 17, 2020
@lukastaegert lukastaegert deleted the escaping-fixes branch June 17, 2020 17:54
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

3 participants