Skip to content
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

Add t tags for hashtags #592

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

dsaxton
Copy link

@dsaxton dsaxton commented Dec 18, 2024

$ cargo test -p notedeck_columns test_extract_hashtags

    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.25s
     Running unittests src/lib.rs (target/debug/deps/notedeck_columns-dfddfaabc1efa03f)

running 1 test
test post::tests::test_extract_hashtags ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 22 filtered out; finished in 0.00s

Also tested manually in Notedeck and it seems to work.

Relates to #286

@jb55
Copy link
Contributor

jb55 commented Dec 18, 2024

#tag1,#tag2 should pass as well -> ["tag1", "tag2"]

@jb55
Copy link
Contributor

jb55 commented Dec 25, 2024

diff --git a/crates/notedeck_columns/src/post.rs b/crates/notedeck_columns/src/post.rs
index 1943278cdd4c..0ca834489f51 100644
--- a/crates/notedeck_columns/src/post.rs
+++ b/crates/notedeck_columns/src/post.rs
@@ -160,7 +160,7 @@ mod tests {
             ("Duplicate #tag #tag #tag", vec!["tag"]),
             ("Mixed case #TaG #tag #TAG", vec!["tag"]),
             (
-                "#tag1, #tag2, #tag3 with commas",
+                "#tag1,#tag2,#tag3 with commas",
                 vec!["tag1", "tag2", "tag3"],
             ),
         ];
assertion `left == right` failed: Failed for input: #tag1,#tag2,#tag3 with commas
  left: {"tag1,#tag2,#tag3"}
 right: {"tag1", "tag3", "tag2"}

@dsaxton
Copy link
Author

dsaxton commented Dec 25, 2024

diff --git a/crates/notedeck_columns/src/post.rs b/crates/notedeck_columns/src/post.rs
index 1943278cdd4c..0ca834489f51 100644
--- a/crates/notedeck_columns/src/post.rs
+++ b/crates/notedeck_columns/src/post.rs
@@ -160,7 +160,7 @@ mod tests {
             ("Duplicate #tag #tag #tag", vec!["tag"]),
             ("Mixed case #TaG #tag #TAG", vec!["tag"]),
             (
-                "#tag1, #tag2, #tag3 with commas",
+                "#tag1,#tag2,#tag3 with commas",
                 vec!["tag1", "tag2", "tag3"],
             ),
         ];
assertion `left == right` failed: Failed for input: #tag1,#tag2,#tag3 with commas
  left: {"tag1,#tag2,#tag3"}
 right: {"tag1", "tag3", "tag2"}

Fixed. Not sure about #tag1.#tag2 but I made that two separate tags (although periods within a hashtag would not work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants