From ababcb7b1d49428cf94165796b1a2df62a04db69 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 31 Dec 2018 12:43:13 -0800 Subject: [PATCH] Work when site uses extensions for pages other than .html --- src/main/Main.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/Main.coffee b/src/main/Main.coffee index d607d5ab3..17ce8ae8f 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -176,10 +176,10 @@ Main = if pathname[2] in ['thread', 'res'] g.VIEW = 'thread' - g.THREADID = +pathname[3].replace('.html', '') - else if /^(?:catalog|archive)(?:\.html)?$/.test(pathname[2]) - g.VIEW = pathname[2].replace('.html', '') - else if /^(?:index|\d*)(?:\.html)?$/.test(pathname[2]) + g.THREADID = +pathname[3].replace(/\.\w+$/, '') + else if /^(?:catalog|archive)(?:\.\w+)?$/.test(pathname[2]) + g.VIEW = pathname[2].replace(/\.\w+$/, '') + else if /^(?:index|\d*)(?:\.\w+)?$/.test(pathname[2]) g.VIEW = 'index' else return