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

.text doesn't give \n or \r #194

Open
TheCarpetMerchant opened this issue Jan 2, 2023 · 0 comments
Open

.text doesn't give \n or \r #194

TheCarpetMerchant opened this issue Jan 2, 2023 · 0 comments

Comments

@TheCarpetMerchant
Copy link

TheCarpetMerchant commented Jan 2, 2023

final doc = parse('<p>Some text</p><p>Some more text</p>');
print(doc.querySelector('body')?.text);
// 'Some textSome more text'

Granted, trying to get an accurate representation of pure text is a bit non-sensical, but I think we should get as close as possible. Here, having a second getter that keeps as many return to line as needed to be a bit more accurate would be welcome.

My precise need is word-count in a reading app.

Edit : this would be similar to the output of javascript's innerText.

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

No branches or pull requests

1 participant