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

<br/> Tag does not product /n #1090

Open
tolotrasamuel opened this issue Aug 1, 2024 · 0 comments
Open

<br/> Tag does not product /n #1090

tolotrasamuel opened this issue Aug 1, 2024 · 0 comments

Comments

@tolotrasamuel
Copy link

Code:


import 'package:html/parser.dart';

class HtmlUtil{
  String? toPlainTxt(String htmlString) {
    final document = parse(htmlString);
    final parsedString = parse(document.body?.text).documentElement?.text;

    return parsedString;
  }
}

Input:
<p>Hello<br/><span style="color:#f00">This is colorful</span></p>

Output:
HelloThis is colorful

Expected:
Hello\nThis is colorful
Screenshot 2024-08-01 at 2 15 38 AM

@mosuem mosuem transferred this issue from dart-archive/html Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants