aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.html b/index.html
index f04ccbc..b71536e 100644
--- a/index.html
+++ b/index.html
@@ -183,6 +183,7 @@
constructor(rawText) {
this.lines = rawText.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n')
this.tokens = []
+ this.defs = new Set()
}
tokenize() {
@@ -320,6 +321,7 @@
if (firstTick !== -1 && lastTick !== -1 && lastTick > firstTick) {
name = line.substring(0, firstTick).trim()
+ if (!this.defs.has(name)) this.defs.add(name)
code = line.substring(firstTick + 1, lastTick)
let remainder = line.substring(lastTick + 1).trim()
@@ -412,7 +414,7 @@
const parser = new TempoParser(text)
parser.tokenize()
- const html = parser.render()
+ const html = parser.render().replace(/{{dict_size}}/g, `<b>${parser.defs.size - 1}</b>`)
// store first 4kb of website in local storage
document.getElementById('content').innerHTML = html