Skip to content

Added support for atomic tags; ignore tag attributes; interpret whitespace; pass in wrapper class name #4

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

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

Conversation

keanulee
Copy link

A few changes that made this library useful for us. Here are the changes:

  • Atomic tags - Tags such as <math> and <svg> tags do not support <ins> and <del> tags as children. So during the tokenization step, we consider these tags as a single token.
  • Ignore tag attributes - When running the diff, we ignore changes in tag attributes. When two tags are considered equivalent, we output the tag from the after list of tokens.
  • Interpret whitespace - Collapse adjacent whitespace (as adjacent whitespace is meaningless in HTML, except for <pre> tags - a case this does NOT handle), and then convert non-breaking whitespace to regular spaces (e.g. '&nbsp;' == ' ').
  • Wrapper class name - allows an arbitrary class name to be included in the <ins> and <del> tags.
  • Tests - To support all these changes.

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