mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
InlineTags: Handle case of #a#b as two tags
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user