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
17601760[[fr:Canadien National]]" ;
17611761 // TODO: Seemingly broken during UnitTest migration
17621762 // 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" ) ;
17631769 }
17641770
17651771 [ Test ]
Original file line number Diff line number Diff line change @@ -1170,12 +1170,14 @@ private List<string> RemoveInterWikis(ref string articleText)
11701170
11711171 List < Match > goodMatches = new List < Match > ( ) ;
11721172 List < string > interWikiListLinksOnly = new List < string > ( ) ;
1173+ List < string > allTemplates = Parsers . GetAllTemplateDetail ( articleText ) ;
11731174
11741175 foreach ( Match m in WikiRegexes . PossibleInterwikis . Matches ( articleText ) )
11751176 {
11761177 string site = m . Groups [ 1 ] . Value . Trim ( ) . ToLower ( ) ;
11771178
1178- if ( ! PossibleInterwikis . Contains ( site ) )
1179+ // ignore interwikis in template calls
1180+ if ( ! PossibleInterwikis . Contains ( site ) || allTemplates . Any ( ( t => t . Contains ( ( m . Value ) ) ) ) )
11791181 continue ;
11801182
11811183 if ( unformattedText . Contains ( m . Value ) )
You can’t perform that action at this time.
0 commit comments