From cec12d4ef90a61a3f38f8ab22c46e76f2a395885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Eckerstr=C3=B6m?= Date: Sat, 16 May 2026 17:53:07 +0200 Subject: [PATCH] Allow dots in wiki link syntax The `[[...]]` internal link regex excluded `.`, so titles like `[[1.2.3]]` rendered as literal text instead of a link. Add `.` to the allowed character class. Fixes #608 --- lib/services/markup.rb | 2 +- test/unit/markup_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/services/markup.rb b/lib/services/markup.rb index 500a7eda..2657cee2 100644 --- a/lib/services/markup.rb +++ b/lib/services/markup.rb @@ -21,7 +21,7 @@ def call end class WikiLinkFilter < HTMLPipeline::TextFilter - WIKI_LINK_REGEXP = /\[\[(?[\d\w\sÅÄÖåäö:-]{1,35})\]\]/i.freeze + WIKI_LINK_REGEXP = /\[\[(?[\d\w\sÅÄÖåäö.:-]{1,35})\]\]/i.freeze def call content = text diff --git a/test/unit/markup_test.rb b/test/unit/markup_test.rb index 974001c1..00fcb6b8 100644 --- a/test/unit/markup_test.rb +++ b/test/unit/markup_test.rb @@ -32,6 +32,13 @@ def test_wiki_link_filter_with_multiple_links_on_two_rows assert_equal html_output, Markup.to_html(content) end + def test_wiki_link_filter_with_dot_in_link + content = %([[1.2.3]]) + html_output = %(

1.2.3

\n) + + assert_equal html_output, Markup.to_html(content) + end + def test_wikified_with_markdown content = %([[Server]]) html_output = %(

Server

\n)