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

Improve whitespace handling - Fixes #21 #22

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

grahambates
Copy link

Instead of trimming each text element as we go, it's better to normalize the complete string at the end. This preserves whitespace between HTML elements.

All whitespace characters within a string are now converted to a single space, according to normal HTML behavior. Line breaks should not be significant and I've updated the test expectations to reflect this. I've also added an example case of an inline element within a microdata property, which would previously cause the issue described in #21.

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.

1 participant