From 71705d6e7486f7cfce4e58a821d3e87372ec9e34 Mon Sep 17 00:00:00 2001 From: blankie Date: Mon, 10 Oct 2022 17:04:11 +0700 Subject: [PATCH] Fix used in links that have a namespace in file pages Example: /ben10/wiki/File:OS_Timespan.png https://github.com/Wikia/app/blob/fe60579a53f16816d65dad1644363160a63206a6/includes/Title.php#L1266 --- src/page-file.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/page-file.rkt b/src/page-file.rkt index a8a41a8..1802568 100644 --- a/src/page-file.rkt +++ b/src/page-file.rkt @@ -31,8 +31,7 @@ (rawImageUrl . "https://static.wikia.nocookie.net/examplefile") (userName . "blankie") (isPostedIn . #t) - (smallerArticleList . (#hasheq((title . "Example_article") - (titleText . "Example article")))) + (smallerArticleList . (#hasheq((titleText . "Test:Example article")))) (articleListIsSmaller . 0) (exists . #t) (imageDescription . #f)))) @@ -89,8 +88,8 @@ ,(if is-posted-in `(p "This file is used in " ,@(map (λ (article) - (define page-path (jp "/title" article)) - (define title (jp "/titleText" article page-path)) + (define title (jp "/titleText" article)) + (define page-path (regexp-replace* #rx" " title "_")) `(span ,(if (eq? (car smaller-article-list) article) "" ", ") (a (@ (href ,(format "/~a/wiki/~a" wikiname page-path))) ,title)))