{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":185476675,"defaultBranch":"master","name":"htmlq","ownerLogin":"mgdm","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2019-05-07T20:55:20.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/71893?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1681555284.0","currentOid":""},"activityList":{"items":[{"before":"2e79d8c06881649d89cb0e5da0cc334929176af0","after":"6e31bc814332b2521f0316d0ed9bf0a1c521b6e6","ref":"refs/heads/master","pushedAt":"2023-04-15T10:54:56.000Z","pushType":"push","commitsCount":5,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"Merge branch 'zdebra-master'","shortMessageHtmlLink":"Merge branch 'zdebra-master'"}},{"before":"739cd363543cd5c36a2d7bcbbb3ab7e811205611","after":"2e79d8c06881649d89cb0e5da0cc334929176af0","ref":"refs/heads/master","pushedAt":"2023-04-15T10:45:53.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"Bump Rust edition","shortMessageHtmlLink":"Bump Rust edition"}},{"before":"df1ca3715b53f7f6420f9ea7bf1bae653ca40dd5","after":"09af14b1d2f1c1d4a7384c969ce4da9c658d23a0","ref":"refs/heads/zamu-refactor","pushedAt":"2023-04-15T10:44:26.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"Bump Rust edition","shortMessageHtmlLink":"Bump Rust edition"}},{"before":"739cd363543cd5c36a2d7bcbbb3ab7e811205611","after":"df1ca3715b53f7f6420f9ea7bf1bae653ca40dd5","ref":"refs/heads/zamu-refactor","pushedAt":"2023-04-15T10:41:56.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"refactor: URL Rewriting, Writing to Output\n\nI ran into an issue where a website had a malformed `href` in a `link` element so URL rewriting failed. I tried to just use `-r` to remove the nodes from the selected set, but htmlq still panicked.\n\nI decided to look at the code to fix it and found some improvements along the way.\n\n---\n\nChanges\n\n* Refactored code to only rewrite URLs when they are part of the selected elements\n * As part of this refactor, we also only remove nodes when they are part of the selected nodes.\n * Node Removal CSS Selectors were joined into a single selector as they are semantically the same.\n * eg. looping over `a` and `link` is the same as just using the single selector `a, link`\n * Refactored node removal to happen before URL rewrites.\n * Refactored `rewrite_relative_urls` with `rewrite_relative_url`\n * Removes leading forward slashes ('/') from `href`s in `a`, `link`, or `area` elems and doesn't join them if they have 4 or more leading forward slashes.\n\n* Replaced `output.write_all` calls with `writeln!` calls.\n * This should reduce string allocations to just include newlines.\n * It also only operates on nodes we've already selected instead of the whole tree.\n\n* Also replaced as many `.unwrap()` calls within the code (left the ones in the test since they should be fine.\n * Mainly changed over to `.expects()`, `.unwrap_or_default()`, or `.unwrap_or_else()` calls\n * Some minor Rust changes to use newer constructs like [`let-else`](https://rust-lang.github.io/rfcs/3137-let-else.html)","shortMessageHtmlLink":"refactor: URL Rewriting, Writing to Output"}},{"before":null,"after":"739cd363543cd5c36a2d7bcbbb3ab7e811205611","ref":"refs/heads/zamu-refactor","pushedAt":"2023-04-15T10:41:24.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"Add flake.nix","shortMessageHtmlLink":"Add flake.nix"}},{"before":null,"after":"323b4b8c367223402fb92206139af1cf15161314","ref":"refs/heads/update-deps","pushedAt":"2023-04-14T21:22:58.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"mgdm","name":"Michael Maclean","path":"/mgdm","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/71893?s=80&v=4"},"commit":{"message":"Update cargo deps","shortMessageHtmlLink":"Update cargo deps"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAADGVOPpgA","startCursor":null,"endCursor":null}},"title":"Activity ยท mgdm/htmlq"}