From 779f22c3a51ce4537b140b9a272bc3075356ce64 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 23 Nov 2006 11:51:31 +0100 Subject: [PATCH] Fix content negotiation stripping: keep # anchors in urls. --- stepmake/bin/add-html-footer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stepmake/bin/add-html-footer.py b/stepmake/bin/add-html-footer.py index dc6c537656..7d2b8fc961 100644 --- a/stepmake/bin/add-html-footer.py +++ b/stepmake/bin/add-html-footer.py @@ -309,9 +309,10 @@ def i18n (file_name, page): and os.path.exists (file_lang (file_name, x[0])), LANGUAGES) - # Strip .html, .png suffix for auto language selection. -# page = re.sub ('''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html(#[^"]*)|.png)[\'"]''', -# '\\1="\\2"', page) + # Strip .html, .png suffix for auto language selection (content + # negotiation). + page = re.sub ('''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''', + '\\1="\\2\\4"', page) # Create language menu. language_menu = '' -- 2.39.2