From cf51d5f0abe3bb6de49478d6f0f8296656748313 Mon Sep 17 00:00:00 2001
From: Sohom <sdatta4@ncsu.edu>
Date: Tue, 14 Oct 2025 11:41:43 -0400
Subject: [PATCH] Parse titleblacklist message as wikitext before showing in
 error dialog

Bug: T407157
Change-Id: Ic424d05de473f4a77c700160b2ca5002baea35de
---
 i18n/en.json                               | 2 +-
 resources/details/uw.TitleDetailsWidget.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/i18n/en.json b/i18n/en.json
index f2b336c3..503d289e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -201,7 +201,7 @@
 	"mwe-upwiz-fileexists-replace-no-link": "Please choose a different title, because this title is already in use by another file.",
 	"mwe-upwiz-blacklisted-details-titleblacklist-custom-filename": "Please write a more informative title ([$2 view examples]).",
 	"mwe-upwiz-blacklisted-details-titleblacklist-custom-filename-title": "Title examples",
-	"mwe-upwiz-blacklisted-details-titleblacklist-custom-filename-text": "<p><b>Examples of good file names:</b></p><ul><li>Nodnol skyline from Nodnol City Hall - Aug 2022</li><li>1875 Meeting of Settlers at Falconer Bay, New Nodland</li><li>Pseudohedron with no vertex visible from center</li></ul><br><p><b>Examples of bad file names:</b></p><ul><li>Image01</li><li>Joe</li><li>DSC00001</li><li>Foo.svg.png</li><li>30996951316264l</li><li>PSEUDOHEDRON WITH NO VERTEX VISIBLE FROM CENTER</li></ul><p><a href='https://commons.wikimedia.org/wiki/MediaWiki:Titleblacklist-custom-filename' target='_blank'>Learn more</a></p>",
+	"mwe-upwiz-blacklisted-details-titleblacklist-custom-filename-text": "<p><b>Examples of good file names:</b></p><ul><li>Nodnol skyline from Nodnol City Hall - Aug 2022</li><li>1875 Meeting of Settlers at Falconer Bay, New Nodland</li><li>Pseudohedron with no vertex visible from center</li></ul><br><p><b>Examples of bad file names:</b></p><ul><li>Image01</li><li>Joe</li><li>DSC00001</li><li>Foo.svg.png</li><li>30996951316264l</li><li>PSEUDOHEDRON WITH NO VERTEX VISIBLE FROM CENTER</li></ul><p>[https://commons.wikimedia.org/wiki/MediaWiki:Titleblacklist-custom-filename Learn more]</p>",
 	"mwe-upwiz-blacklisted-details": "This file name contains invalid characters or is in an invalid format. ([$2 Click here] for guidance on correcting this issue.)",
 	"mwe-upwiz-blacklisted-details-feedback": "Please write a different, descriptive title ([$2 more info]) • [$3 Send feedback]",
 	"mwe-upwiz-next": "Next",
diff --git a/resources/details/uw.TitleDetailsWidget.js b/resources/details/uw.TitleDetailsWidget.js
index d01d05ef..350b12c3 100644
--- a/resources/details/uw.TitleDetailsWidget.js
+++ b/resources/details/uw.TitleDetailsWidget.js
@@ -215,7 +215,7 @@
 					const titleMessage = mw.message( messageKey + '-title' ),
 						title = titleMessage.exists() ? titleMessage.text() : '',
 						textMessage = mw.message( messageKey + '-text' ),
-						text = textMessage.exists() ? textMessage.text() : result.blacklist.blacklistReason;
+						text = textMessage.exists() ? textMessage.parse() : result.blacklist.blacklistReason;
 
 					mw.errorDialog( text, title );
 				}
-- 
2.43.0

