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

Avoid inserting separators to where the source has one #342

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

kojiishi
Copy link
Collaborator

@kojiishi kojiishi commented Oct 25, 2023

This patch changes the HtmlProcessor not to insert separators (<wbr>, &ZeroWidthSpace;, or whatever the caller specified) to where the source has <wbr> or &ZeroWidthSpace;.

This is to avoid inserting separators multiple times to the same place when HtmlProcessor is applied multiple times.

Fixes #290.

This patch changes the `HtmlProcessor` not to insert separators
(`<wbr>`, `&ZeroWidthSpace;`, or whatever the caller specified) to where
the source has `<wbr>` or `&ZeroWidthSpace;`.

This is to avoid inserting separators multiple times to the same place
when `HtmlProcessor` is applied multiple times.
Copy link
Member

@tushuhei tushuhei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this! I added some comments mostly from the style perspectives.

javascript/src/html_processor.ts Outdated Show resolved Hide resolved
javascript/src/html_processor.ts Outdated Show resolved Hide resolved
javascript/src/html_processor.ts Outdated Show resolved Hide resolved
javascript/src/html_processor.ts Outdated Show resolved Hide resolved
javascript/src/html_processor.ts Outdated Show resolved Hide resolved
Copy link
Member

@tushuhei tushuhei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you.

@kojiishi kojiishi merged commit 65dbb4a into google:main Oct 25, 2023
19 checks passed
@kojiishi kojiishi deleted the dupwbr branch October 25, 2023 12:40
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.

Deduplicate separators when processing HTML
2 participants