From 24957748918403a387fbae47f593001ce361891a Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 18 Apr 2016 19:59:56 -0700 Subject: Better tag rendering --- util/compile.py | 8 ++++---- util/tmpl/term.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'util') 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}}
{{#each tags}} - {{@key}} + {{@key}} {{/each}}
{{/if}} -- cgit v1.2.3