From af2baff093465e7fda6a63a58d60adb1020af443 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 22 Apr 2021 18:04:51 +0100 Subject: [PATCH] Revert "Simplify" This reverts commit 7ca1a5aee9cb9ad450721cb9f4efe72c7eb7e3f6. --- webapp_post.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 9cc8617a2..18ded1c34 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -138,10 +138,14 @@ def preparePostFromHtmlCache(nickname: str, postHtml: str, boxName: str, for keyIndex in range(10): keyStr = 'accesskey="' + str(keyIndex) + '"' if keyStr in withPageNumber: - withPageNumber = \ - withPageNumber.replace(keyStr, - 'accesskey="' + - str(accessKeyIndex) + '"') + if accessKeyIndex == 0 or accessKeyIndex > 9: + withPageNumber = \ + withPageNumber.replace(keyStr, '') + else: + withPageNumber = \ + withPageNumber.replace(keyStr, + 'accesskey="' + + str(accessKeyIndex) + '"') break return prepareHtmlPostNickname(nickname, withPageNumber)