{"id":20042734,"url":"https://github.com/documize/html-diff","last_synced_at":"2025-03-02T07:19:24.813Z","repository":{"id":57480785,"uuid":"50854470","full_name":"documize/html-diff","owner":"documize","description":"Calculate difference between two HTML snippets (in Go)","archived":false,"fork":false,"pushed_at":"2016-05-03T14:02:53.000Z","size":528,"stargazers_count":35,"open_issues_count":0,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-12T19:35:58.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/documize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-01T16:50:33.000Z","updated_at":"2024-06-17T21:08:55.000Z","dependencies_parsed_at":"2022-09-26T17:41:21.818Z","dependency_job_id":null,"html_url":"https://github.com/documize/html-diff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/documize%2Fhtml-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/documize%2Fhtml-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/documize%2Fhtml-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/documize%2Fhtml-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/documize","download_url":"https://codeload.github.com/documize/html-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241470961,"owners_count":19968139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:53:03.316Z","updated_at":"2025-03-02T07:19:24.785Z","avatar_url":"https://github.com/documize.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-diff\n\nCalculate difference between two HTML snippets and return those differences as a merged HTML snippet showing the changes.\n\nUsage:\n```\n\tvar cfg = \u0026htmldiff.Config{\n\t\tGranularity:  5,\n\t\tInsertedSpan: []htmldiff.Attribute{{Key: \"style\", Val: \"background-color: palegreen;\"}},\n\t\tDeletedSpan:  []htmldiff.Attribute{{Key: \"style\", Val: \"background-color: lightpink;\"}},\n\t\tReplacedSpan: []htmldiff.Attribute{{Key: \"style\", Val: \"background-color: lightskyblue;\"}},\n\t\tCleanTags:    []string{\"\"},\n\t}\n\tres, err := cfg.HTMLdiff([]string{previousHTML, latestHTML})\n\tmergedHTML := res[0]\n```\n![see example_test.go](example_test.png)\n\nOnly deals with body HTML, so no headers, only what is within the body element.\n\nRequires Go1.5+, with vendoring support. Vendors \"github.com/mb0/diff\", \"golang.org/x/net/html\" and \"golang.org/x/net/html/atom\".\n\nRunning the tests will create output files in testout/*.html.\n\nFor fuzz-testing using https://github.com/dvyukov/go-fuzz , the Fuzz() function is in fuzz.go (as at Feb'16 you need to rename the ```vendor``` directory while you fuzz, and go get the dependencies - an issue with \"go/importer\", see https://github.com/golang/go/issues/13756).\n\nPull requests welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocumize%2Fhtml-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocumize%2Fhtml-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocumize%2Fhtml-diff/lists"}