commit e5b03b4b571242187949e95762b667dac1ef4c47 parent b3e3f856c54932666860f554794fe89de47c1378 Author: William Casarin <jb55@jb55.com> Date: Wed, 27 Oct 2021 17:29:04 -0700 use wiki-server's implementation of slugify Diffstat:
M | index.js | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.js b/index.js @@ -4,7 +4,7 @@ const {createServer} = require('@derhuerst/gemini') function slugify(text) { - return text.toLowerCase().split(/\s+/).join('-') + return text.replace(/\s/g, '-').replace(/[^A-Za-z0-9-]/g, '').toLowerCase() } function parse_links(text)