More robust replacement condition in Wikidata summaries

This commit is contained in:
Antonin Delpeuch 2019-02-22 18:04:03 +00:00
parent caebfe8848
commit 50b5ce7561

View File

@ -173,7 +173,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
// Because commas and colons are used by Wikibase to separate the auto-generated summaries // Because commas and colons are used by Wikibase to separate the auto-generated summaries
// from the user-supplied ones, we replace these separators by similar unicode characters to // from the user-supplied ones, we replace these separators by similar unicode characters to
// make sure they can be told apart. // make sure they can be told apart.
String summaryWithoutCommas = _summary.replace(",","").replace(":","։"); String summaryWithoutCommas = _summary.replaceAll(", "," ").replaceAll(": ","։ ");
String summary = summaryWithoutCommas + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])", String summary = summaryWithoutCommas + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])",
(Long.toHexString(token).substring(0, 9))); (Long.toHexString(token).substring(0, 9)));