aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar makc2021-07-29 12:01:52 +0200
committerGravatar Vitaly Takmazov2021-07-29 13:41:28 +0300
commite8b0adab2aecc233a090f98c569931871f977ba4 (patch)
tree9ea3d83d16fd7a7681bf21a645b0ae2d3c0af2ec /src/main/java/com/juick/service
parentcd86dc746b2d8c3bdc70061b4bdd287cd3b394d8 (diff)
better hashtags
https://juick.com/rm/2997070#7
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/TagServiceImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/juick/service/TagServiceImpl.java b/src/main/java/com/juick/service/TagServiceImpl.java
index 93edcccc..0bd6bb0c 100644
--- a/src/main/java/com/juick/service/TagServiceImpl.java
+++ b/src/main/java/com/juick/service/TagServiceImpl.java
@@ -221,7 +221,7 @@ public class TagServiceImpl extends BaseJdbcService implements TagService {
public Pair<String, List<Tag>> fromString(final String txt) {
String firstLine = txt.split("\\n", 2)[0];
Supplier<Stream<String>> tagsStream = () -> Arrays.stream(firstLine.split("\\ "))
- .takeWhile(t -> !t.equals("*") && t.startsWith("*"));
+ .takeWhile(t -> t.matches("\\*[^\\s]+|#[^\\s]*[^\\d][^\\s]*"));
int tagsLength = tagsStream.get().collect(Collectors.joining(" ")).length();
String body = txt.substring(tagsLength);
List<Tag> tags = tagsStream.get().map(t -> getTag(t.substring(1), true))