Skip to content

Commit

Permalink
Fixed hierarchical tags not working in filters
Browse files Browse the repository at this point in the history
Closes #38
  • Loading branch information
HEmile committed Apr 17, 2021
1 parent 6ecbbb7 commit a2b02d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/Features/Juggl code fence.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ The code fence is in the familiar YAML syntax.
The code fence requires one of currently two **modes**. You can use

---
#feature
#feature
- author [[Emile van Krieken]]
5 changes: 3 additions & 2 deletions juggl/viz/query-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const _containsSelector = function(attribute: string, filters: string|string[],
const _tagSelector = function(tag: string|string[]): string[] {
if (typeof(tag) === 'string' || tag instanceof String) {
if (tag.length > 0 && tag[0] === '#') {
return [`.tag-${tag.slice(1)}`];
// @ts-ignore
return [`.tag-${tag.slice(1).replace('/', '-')}`];
}
return [];
}
return tag.map((t) => {
if (t.length > 0 && t[0] === '#') {
return `.tag-${t.slice(1)}`;
return `.tag-${t.slice(1).replace('/', '-')}`;
}
return '';
});
Expand Down

0 comments on commit a2b02d3

Please sign in to comment.