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(html): Handle <br> elements to insert line breaks in text #1950

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Dhruv-Maradiya
Copy link

Fixes #1090 by updating the DOM parser to handle <br> elements and insert line breaks (\n) when converting HTML content to plain text.

Initially, I thought adding a simple condition might not be a reliable solution. So, I decided to check how HTML-to-text conversion is handled in Chromium and found a similar approach. Here's the link.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@Dhruv-Maradiya Dhruv-Maradiya changed the title Fix(html): Handle <br> elements to insert line breaks in text Fix(html): Handle <br> elements to insert line breaks in text Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<br/> Tag does not product /n
1 participant