aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-18 19:59:56 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-18 19:59:56 -0700
commit24957748918403a387fbae47f593001ce361891a (patch)
treee8c881a0097567d4459281a976f85cb162d17d8d /util
parentc4e35fbf54a9cd80e27d600d47b24b1afdfeca6d (diff)
Better tag rendering
Diffstat (limited to 'util')
-rwxr-xr-xutil/compile.py8
-rw-r--r--util/tmpl/term.html2
2 files changed, 5 insertions, 5 deletions
diff --git a/util/compile.py b/util/compile.py
index 9c5a6bdd..d5a916fd 100755
--- a/util/compile.py
+++ b/util/compile.py
@@ -193,15 +193,15 @@ def parse_edict(path):
for index, dfn in enumerate(filter(None, segments[1:])):
dfn_match = re.search(r'^((?:\((?:[\w\-\,\:]*)*\)\s*)*)(.*)$', dfn)
- gloss = dfn_match.group(2).strip()
- if len(gloss) == 0:
- continue
-
tags_raw = set(filter(None, re.split(r'[\s\(\),]', dfn_match.group(1))))
tags_raw = fixup_godan_verbs(tags_raw)
tags_raw = tags_raw.intersection(set(PARSED_TAGS.keys()))
tags = tags.union(tags_raw)
+ gloss = dfn_match.group(2).strip()
+ if len(gloss) == 0:
+ continue
+
if index == 0 or len(dfn_match.group(1)) > 0:
defs.append([gloss])
else:
diff --git a/util/tmpl/term.html b/util/tmpl/term.html
index abcbb215..e97104f1 100644
--- a/util/tmpl/term.html
+++ b/util/tmpl/term.html
@@ -15,7 +15,7 @@
{{#if tags}}
<div class="tags">
{{#each tags}}
- <span class="tag" title="{{desc}}">{{@key}}</span>
+ <span class="tag {{#if class}}tag-{{class}}{{else}}tag-default{{/if}}" title="{{desc}}">{{@key}}</span>
{{/each}}
</div>
{{/if}}