InlineTags: Handle case of #a#b as two tags

This commit is contained in:
Vishesh Handa
2020-08-21 11:12:08 +02:00
parent 61e16daefe
commit cc9d115762
2 changed files with 13 additions and 2 deletions

View File

@ -19,7 +19,10 @@ class InlineTagsProcessor {
tag = tag.substring(0, tag.length - 1);
}
tags.add(tag);
var all = tag.split('#');
for (var t in all) {
tags.add(t.trim());
}
}
}

View File

@ -21,7 +21,15 @@ void main() {
expect(tags, {'tag'});
});
// #a#b should be counted as two tags
test('#a#b should be counted as two tags', () {
var body = "Hi there #a#b";
var p = InlineTagsProcessor();
var tags = p.extractTags(body);
expect(tags, {'a', 'b'});
});
// + should work as a prefix
// @ should work as a prefix
// test for tags with non-ascii words