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: enable client parser to retain carriage return characters #902

Merged

Conversation

kingflamez
Copy link
Contributor

@kingflamez kingflamez commented Dec 1, 2024

What is the motivation for this pull request?

Bug fix

What is the current behavior?

Closes #420
Addresses html-react-parser #864

What is the new behavior?

const text = "toto \r\n toto"

parse(text)

old output: "toto toto"
new output: "toto \r\n toto"

Checklist:

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.90%. Comparing base (c4fc01e) to head (67c3826).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #902      +/-   ##
==========================================
+ Coverage   92.59%   92.90%   +0.31%     
==========================================
  Files           7        7              
  Lines         135      141       +6     
  Branches       30       30              
==========================================
+ Hits          125      131       +6     
  Misses          8        8              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@remarkablemark remarkablemark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left 2 comments

src/client/domparser.ts Outdated Show resolved Hide resolved
src/client/utilities.ts Outdated Show resolved Hide resolved
@remarkablemark remarkablemark changed the title Fix: enable client parser to retain carriage return characters fix: enable client parser to retain carriage return characters Dec 1, 2024
@kingflamez
Copy link
Contributor Author

@remarkablemark added tests

Copy link
Owner

@remarkablemark remarkablemark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@remarkablemark remarkablemark merged commit fe2e993 into remarkablemark:master Dec 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carriage return is stripped in client parser
2 participants