René's URL Explorer Experiment


Title: Line normalization before diff · Issue #219 · java-diff-utils/java-diff-utils · GitHub

Open Graph Title: Line normalization before diff · Issue #219 · java-diff-utils/java-diff-utils

X Title: Line normalization before diff · Issue #219 · java-diff-utils/java-diff-utils

Description: Description The DiffRowGenerator class offers the lineNormalizer property. By default, it is used to replace < and > by their escaped versions < and >. The lineNormalizer is applied to the input texts before the diff is calculated....

Open Graph Description: Description The DiffRowGenerator class offers the lineNormalizer property. By default, it is used to replace < and > by their escaped versions < and >. The lineNormalizer is applied to the in...

X Description: Description The DiffRowGenerator class offers the lineNormalizer property. By default, it is used to replace < and > by their escaped versions &lt; and &gt;. The lineNormalizer is app...

Opengraph URL: https://github.com/java-diff-utils/java-diff-utils/issues/219

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Line normalization before diff","articleBody":"**Description**\n\nThe `DiffRowGenerator` class offers the `lineNormalizer` property. By default, it is used to replace `\u003c` and `\u003e` by their escaped versions `\u0026lt;` and `\u0026gt;`.\n\nThe `lineNormalizer` is applied to the input texts before the diff is calculated. While I see this is as a useful feature, in case of the default settings it might be surprising that the resulting text might not have HTML escaping anymore:\n\n```java\nfinal var generator = DiffRowGenerator.create() //\n        .mergeOriginalRevised(true) //\n        .showInlineDiffs(true) //\n        .inlineDiffByWord(true) //\n        .build();\n\nfinal var rows = generator.generateDiffRows(List.of(\"hello \u003cworld\u003e\"), List.of(\"bye \u003eworld\u003c\"));\n\nfinal var resultingText = rows.stream() //\n        .map(DiffRow::getOldLine) //\n        .collect(Collectors.joining(StringUtils.LF));\n``` \n\nThe resulting text is\n```\n\u003cspan class=\"editOldInline\"\u003ehello\u003c/span\u003e\u003cspan class=\"editNewInline\"\u003ebye\u003c/span\u003e \u0026\u003cspan class=\"editOldInline\"\u003elt\u003c/span\u003e\u003cspan class=\"editNewInline\"\u003egt\u003c/span\u003e;world\u0026\u003cspan class=\"editOldInline\"\u003egt\u003c/span\u003e\u003cspan class=\"editNewInline\"\u003elt\u003c/span\u003e;\n``` \n\nNote the part ` \u0026` is considered as an equal text part because both replacements `\u0026lt;` and `\u0026gt;` start with an ampersand. This resulting text is therefore no valid HTML anymore.\n\nIn order for this behaviour to be a problem, the following conditions must all be true:\n\n1. The `inlineDiffByWord` must be used\n2. The default `lineNormalizer` must be used\n3. The two provided texts must differ at a position which starts with a character that is replaced by the `lineNormalizer`\n4. A release \u003e= 4.15 must be used.\n\n**Workaround**\nOverride the `lineNormalizer`. E.g., by using the `SPLIT_BY_WORD_PATTERN` of release 4.12, in which [the ampersand was not considered a character that splits words](https://github.com/java-diff-utils/java-diff-utils/blob/0fd3bd8e061eed09dbb937c8ab9ba0969ba12264/java-diff-utils/src/main/java/com/github/difflib/text/DiffRowGenerator.java#L70).\n\n**Solution approaches**\nIMHO, the `SPLIT_BY_WORD_PATTERN` of release 4.15+ is fine and I do not consider it to be the problem.\n\nThe library could offer one of the following features:\n1. a parameter which defines when the 'lineNormalizer' should be applied (before diff-ing or after)\n2. a second type of line-normalizer that is applied after diff-ing\n3. an option to have the library apply the [`processDiffs` function](https://github.com/java-diff-utils/java-diff-utils/blob/637cb7b6a309d66ff5e0cec2b3ffea52f867edc7/java-diff-utils/src/main/java/com/github/difflib/text/DiffRowGenerator.java#L190) to non-diffs as well\n","author":{"url":"https://github.com/epictecch","@type":"Person","name":"epictecch"},"datePublished":"2025-09-22T14:09:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/219/java-diff-utils/issues/219"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3726ce0d-96c5-019e-5f46-9864efe91fa7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8330:1DC709:766EE9D:A29FD3C:696779C1
html-safe-noncef17b2777a6ee8109172e6edcd8a5ab5113e44cb2187035fed3d5211addf498c2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzMwOjFEQzcwOTo3NjZFRTlEOkEyOUZEM0M6Njk2Nzc5QzEiLCJ2aXNpdG9yX2lkIjoiMzg1NjIyODQ2ODU2MjI5NTIzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9f2a53e1201aa2d24d6afb4e7e57d0ce0767a7a0507a607962c595c0eb1aac31
hovercard-subject-tagissue:3441197175
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/java-diff-utils/java-diff-utils/219/issue_layout
twitter:imagehttps://opengraph.githubassets.com/92be352d38641d59f901d94235c155dcd720aa3e489d9cc8db38b69da1486ce1/java-diff-utils/java-diff-utils/issues/219
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/92be352d38641d59f901d94235c155dcd720aa3e489d9cc8db38b69da1486ce1/java-diff-utils/java-diff-utils/issues/219
og:image:altDescription The DiffRowGenerator class offers the lineNormalizer property. By default, it is used to replace < and > by their escaped versions < and >. The lineNormalizer is applied to the in...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameepictecch
hostnamegithub.com
expected-hostnamegithub.com
None1a6a4ac66aaa8be0077b72a69fd56fb51cd11215a1e31f0365079e012987234a
turbo-cache-controlno-preview
go-importgithub.com/java-diff-utils/java-diff-utils git https://github.com/java-diff-utils/java-diff-utils.git
octolytics-dimension-user_id40540835
octolytics-dimension-user_loginjava-diff-utils
octolytics-dimension-repository_id86663812
octolytics-dimension-repository_nwojava-diff-utils/java-diff-utils
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id86663812
octolytics-dimension-repository_network_root_nwojava-diff-utils/java-diff-utils
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release045909cd564d790cacd96dcb8722039dff679d63
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/java-diff-utils/java-diff-utils/issues/219#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjava-diff-utils%2Fjava-diff-utils%2Fissues%2F219
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjava-diff-utils%2Fjava-diff-utils%2Fissues%2F219
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=java-diff-utils%2Fjava-diff-utils
Reloadhttps://github.com/java-diff-utils/java-diff-utils/issues/219
Reloadhttps://github.com/java-diff-utils/java-diff-utils/issues/219
Reloadhttps://github.com/java-diff-utils/java-diff-utils/issues/219
java-diff-utils https://github.com/java-diff-utils
java-diff-utilshttps://github.com/java-diff-utils/java-diff-utils
Please reload this pagehttps://github.com/java-diff-utils/java-diff-utils/issues/219
Notifications https://github.com/login?return_to=%2Fjava-diff-utils%2Fjava-diff-utils
Fork 215 https://github.com/login?return_to=%2Fjava-diff-utils%2Fjava-diff-utils
Star 1.5k https://github.com/login?return_to=%2Fjava-diff-utils%2Fjava-diff-utils
Code https://github.com/java-diff-utils/java-diff-utils
Issues 1 https://github.com/java-diff-utils/java-diff-utils/issues
Pull requests 1 https://github.com/java-diff-utils/java-diff-utils/pulls
Discussions https://github.com/java-diff-utils/java-diff-utils/discussions
Actions https://github.com/java-diff-utils/java-diff-utils/actions
Projects 0 https://github.com/java-diff-utils/java-diff-utils/projects
Wiki https://github.com/java-diff-utils/java-diff-utils/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/java-diff-utils/java-diff-utils/security
Please reload this pagehttps://github.com/java-diff-utils/java-diff-utils/issues/219
Insights https://github.com/java-diff-utils/java-diff-utils/pulse
Code https://github.com/java-diff-utils/java-diff-utils
Issues https://github.com/java-diff-utils/java-diff-utils/issues
Pull requests https://github.com/java-diff-utils/java-diff-utils/pulls
Discussions https://github.com/java-diff-utils/java-diff-utils/discussions
Actions https://github.com/java-diff-utils/java-diff-utils/actions
Projects https://github.com/java-diff-utils/java-diff-utils/projects
Wiki https://github.com/java-diff-utils/java-diff-utils/wiki
Security https://github.com/java-diff-utils/java-diff-utils/security
Insights https://github.com/java-diff-utils/java-diff-utils/pulse
New issuehttps://github.com/login?return_to=https://github.com/java-diff-utils/java-diff-utils/issues/219
New issuehttps://github.com/login?return_to=https://github.com/java-diff-utils/java-diff-utils/issues/219
#224https://github.com/java-diff-utils/java-diff-utils/pull/224
Line normalization before diffhttps://github.com/java-diff-utils/java-diff-utils/issues/219#top
#224https://github.com/java-diff-utils/java-diff-utils/pull/224
https://github.com/epictecch
https://github.com/epictecch
epictecchhttps://github.com/epictecch
on Sep 22, 2025https://github.com/java-diff-utils/java-diff-utils/issues/219#issue-3441197175
the ampersand was not considered a character that splits wordshttps://github.com/java-diff-utils/java-diff-utils/blob/0fd3bd8e061eed09dbb937c8ab9ba0969ba12264/java-diff-utils/src/main/java/com/github/difflib/text/DiffRowGenerator.java#L70
processDiffs functionhttps://github.com/java-diff-utils/java-diff-utils/blob/637cb7b6a309d66ff5e0cec2b3ffea52f867edc7/java-diff-utils/src/main/java/com/github/difflib/text/DiffRowGenerator.java#L190
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.