File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1760,6 +1760,12 @@ The following links are here to prevent the interwiki bot from adding them to th
1760
1760
[[fr:Canadien National]]" ;
1761
1761
// TODO: Seemingly broken during UnitTest migration
1762
1762
// Assert.That(parser2.Sorter.Interwikis(ref a), Is.EqualTo(a + "\r\n"), "first letter casing retained for jbo-wiki links");
1763
+
1764
+ string i = @"{{Canadianmetros|
1765
+ [[it:CN]]
1766
+ [[sv:CN]]
1767
+ }}" ;
1768
+ Assert . That ( parser2 . Sorter . Interwikis ( ref i ) , Is . Empty , "interwikis not taken out of templates" ) ;
1763
1769
}
1764
1770
1765
1771
[ Test ]
Original file line number Diff line number Diff line change @@ -1170,12 +1170,14 @@ private List<string> RemoveInterWikis(ref string articleText)
1170
1170
1171
1171
List < Match > goodMatches = new List < Match > ( ) ;
1172
1172
List < string > interWikiListLinksOnly = new List < string > ( ) ;
1173
+ List < string > allTemplates = Parsers . GetAllTemplateDetail ( articleText ) ;
1173
1174
1174
1175
foreach ( Match m in WikiRegexes . PossibleInterwikis . Matches ( articleText ) )
1175
1176
{
1176
1177
string site = m . Groups [ 1 ] . Value . Trim ( ) . ToLower ( ) ;
1177
1178
1178
- if ( ! PossibleInterwikis . Contains ( site ) )
1179
+ // ignore interwikis in template calls
1180
+ if ( ! PossibleInterwikis . Contains ( site ) || allTemplates . Any ( ( t => t . Contains ( ( m . Value ) ) ) ) )
1179
1181
continue ;
1180
1182
1181
1183
if ( unformattedText . Contains ( m . Value ) )
You can’t perform that action at this time.
0 commit comments