Filtering empty tags.
@@ -1110,9 +1110,9 @@ export function extractHashtags(str) {
if (!is("String", str)) {
"utils.js: extractHashtags expects a string but got: " + str;
}
- const tags = (str.trim().split(/\s*,\s*|\s+/) || []).map(
- str => (str.startsWith("#") ? str.substring(1) : str)
- ); // remove leading `#`-character
+ const tags = (str.trim().split(/\s*,\s*|\s+/) || [])
+ .map(str => (str.startsWith("#") ? str.substring(1) : str))
+ .filter(str => str != ""); // remove leading `#`-character
return Array.from(new Set(tags)); // filter out duplicates and return
}
