Skip to content

Support backslash escaping, retain exact newline escaping#3638

Merged
lukastaegert merged 1 commit intomasterfrom
escaping-fixes
Jun 17, 2020
Merged

Support backslash escaping, retain exact newline escaping#3638
lukastaegert merged 1 commit intomasterfrom
escaping-fixes

Conversation

@guybedford
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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.

3 participants