Skip to content

Commit

Permalink
ref #5
Browse files Browse the repository at this point in the history
  • Loading branch information
nabbisen committed Jun 22, 2024
1 parent a51f575 commit 4a427a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "htmlproc"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
authors = ["nabbisen <[email protected]>"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/omit_enclosures/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ mod tests {

#[test]
fn manipulate_6() {
let source = r#"<!DOCTYPE html><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;">To avoid polluting the<span class="Apple-converted-space"> </span></span><a href="https://github.com/NixOS/nixpkgs/issues/50105#top" title="Click to open https://github.com/NixOS/nixpkgs/issues/50105#top" style="font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none; font-weight: bold; color: rgb(0, 102, 153);">New nixpkgs committers requests<span class="Apple-converted-space"> </span></a><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;"></span><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none;">#50105</span><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;"><span class="Apple-converted-space"> </span>with dialouge not around new applications, wanted to move the discussion to here.</span>"#;
let source = r#"<!DOCTYPE html><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;">To avoid polluting the<span class="Apple-converted-space"> </span></span><a href="https://github.com/" title="Click to open https://github.com/" style="font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none; font-weight: bold; color: rgb(0, 102, 153);">some text<span class="Apple-converted-space"> </span></a><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;"></span><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none;">#50105</span><span style="caret-color: rgb(10, 10, 10); color: rgb(10, 10, 10); font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); text-decoration: none; display: inline !important; float: none;"><span class="Apple-converted-space"> </span>trailing text</span>"#;
let omits = &["span"];
let expect = r#"To avoid polluting the <a href="https://github.com/NixOS/nixpkgs/issues/50105#top" title="Click to open https://github.com/NixOS/nixpkgs/issues/50105#top" style="font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none; font-weight: bold; color: rgb(0, 102, 153);">New nixpkgs committers requests </a>#50105 with dialouge not around new applications, wanted to move the discussion to here."#;
let expect = r#"To avoid polluting the <a href="https://github.com/" title="Click to open https://github.com/" style="font-family: Arial, sans-serif; font-size: 14.036885px; font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none; font-weight: bold; color: rgb(0, 102, 153);">some text </a>#50105 trailing text"#;

let result = manipulate(source, omits);
assert_eq!(result, expect);
Expand Down

0 comments on commit 4a427a3

Please sign in to comment.