diff options
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -26,6 +26,10 @@ const wordCount = () => { nodes.reduce((a,p) => { const n = data.pages[data.paths[p]]; return a + n.body.trim().split(/\s+/).length + n.choices.reduce((a,c) => a + c[1].trim().split(/\s+/).length, 0)}, 0); + const n = data.pages[data.paths[data.current]]; + document.querySelector("#page-word-count span").innerText = + n.body.trim().split(/\s+/).length + + n.choices.reduce((a,c) => a + c[1].trim().split(/\s+/).length, 0); }; const db = new Dexie("vanguard-editor"); |