Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add option to ignore attributes #49

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
dchacke wants to merge 4 commits into Teamwork:master
base: master
Choose a base branch
Loading
from dchacke:ignore-attributes

Conversation

@dchacke
Copy link

@dchacke dchacke commented Sep 23, 2025

I needed a way to ignore attributes because I’m diffing markdown-generated html.

Some markdown libraries assign ids to headings based on content. For example:

# heading

Will generate:

<h1 id="heading">heading</h1>

If a user changes that to # heading foo, they will only care that the content of the heading changed. They won’t care that the id changed to "heading-foo". They won’t even know that such an id even exists, so causing it to display a modification to the entire heading would only confuse the user. They would only want to see the insertion of "foo".

I did my best to add passing tests but I was unsure about one thing: diff.ts:587, areNodesEqual(previousSibling, formattingNode) did not require the new option, for some reason. All tests already pass without changing it to areNodesEqual(previousSibling, formattingNode, false, ignoreAttributes). I don’t know why. Maybe I’m missing a test case.

Copy link
Author

dchacke commented Sep 23, 2025

Btw, it looks like there are some outdated NPM packages with security vulnerabilities such as this one: https://nvd.nist.gov/vuln/detail/CVE-2023-45311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /