r80753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80752‎ | r80753 | r80754 >
Date:16:34, 22 January 2011
Author:platonides
Status:deferred
Tags:
Comment:
Don't look for pipes in the root node.
Modified paths:
  • /trunk/extensions/NativePreprocessor/preprocesstoobj.c (modified) (history)
  • /trunk/phase3/tests/parser/preprocess/Fundraising.expected (added) (history)
  • /trunk/phase3/tests/parser/preprocess/Fundraising.txt (added) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php
@@ -82,6 +82,7 @@
8383 array( "{{#if: {{{1|}}} | 1 | {{#if: {{{1|}}} | 2 | 3 }} }}", "<root><template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> 1 </value></part><part><name index=\"2\" /><value> <template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> 2 </value></part><part><name index=\"2\" /><value> 3 </value></part></template> </value></part></template></root>"),
8484 array( "{{ {{Foo}}", "<root>{{ <template><title>Foo</title></template></root>"),
8585 array( "{{Foobar {{Foo}} {{Bar}} {{Baz}} ", "<root>{{Foobar <template><title>Foo</title></template> <template><title>Bar</title></template> <template><title>Baz</title></template> </root>"),
 86+ array( "[[Foo]] |", "<root>[[Foo]] |</root>"),
8687 /* array( file_get_contents( dirname( __FILE__ ) . '/QuoteQuran.txt' ), file_get_contents( dirname( __FILE__ ) . '/QuoteQuranExpanded.txt' ) ), */
8788 );
8889 }
@@ -101,6 +102,7 @@
102103 array( "QuoteQuran" ), # http://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC-BY-SA by Striver
103104 array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
104105 array( "All_system_messages" ), # http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765 GPL text generated by MediaWiki
 106+ array( "Fundraising" ), # http://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC-BY-SA, copied there by Sky Harbor.
105107 );
106108 }
107109
Index: trunk/phase3/tests/parser/preprocess/Fundraising.txt
@@ -0,0 +1,17 @@
 2+<div name="fundraising" id="fundraising" class="plainlinks" style="margin-top:5px; text-align: center; background-color: #ffffe0; border: solid 1px #e0e0c0">
 3+'''Pwede kang [[Wikimedia:give the gift of knowledge|maghandog ng kaalaman]] sa paraan ng [[Wikimedia:Fundraising#Donation_methods|pagbibigay ng donasyon sa Pundasyong Wikimedia!]]'''
 4+<br />
 5+<fundraising/>
 6+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 7+<fundraisinglogo/>
 8+<br />
 9+<b>Ngayon, ang iyong [[Wikimedia:Fundraising|kontribusyon]] ay [[Wikimedia:Fundraising FAQ|itatambal]] ng isang anonimong kaibigan.</b>
 10+<br />
 11+<small>
 12+[[Wikimedia:Deductibility of donations|Pagbabawas sa mga buwis ng donasyon]]
 13+|
 14+[[Wikimedia:Fundraising FAQ|FAQ]]
 15+|
 16+[http://upload.wikimedia.org/wikipedia/foundation/2/28/Wikimedia_2006_fs.pdf Mga pampananalaping pahayag]
 17+</small>
 18+</div>
Property changes on: trunk/phase3/tests/parser/preprocess/Fundraising.txt
___________________________________________________________________
Added: svn:eol-style
119 + native
Index: trunk/phase3/tests/parser/preprocess/Fundraising.expected
@@ -0,0 +1,18 @@
 2+<root>&lt;div name=&quot;fundraising&quot; id=&quot;fundraising&quot; class=&quot;plainlinks&quot; style=&quot;margin-top:5px; text-align: center; background-color: #ffffe0; border: solid 1px #e0e0c0&quot;&gt;
 3+'''Pwede kang [[Wikimedia:give the gift of knowledge|maghandog ng kaalaman]] sa paraan ng [[Wikimedia:Fundraising#Donation_methods|pagbibigay ng donasyon sa Pundasyong Wikimedia!]]'''
 4+&lt;br /&gt;
 5+&lt;fundraising/&gt;
 6+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 7+&lt;fundraisinglogo/&gt;
 8+&lt;br /&gt;
 9+&lt;b&gt;Ngayon, ang iyong [[Wikimedia:Fundraising|kontribusyon]] ay [[Wikimedia:Fundraising FAQ|itatambal]] ng isang anonimong kaibigan.&lt;/b&gt;
 10+&lt;br /&gt;
 11+&lt;small&gt;
 12+[[Wikimedia:Deductibility of donations|Pagbabawas sa mga buwis ng donasyon]]
 13+|
 14+[[Wikimedia:Fundraising FAQ|FAQ]]
 15+|
 16+[http://upload.wikimedia.org/wikipedia/foundation/2/28/Wikimedia_2006_fs.pdf Mga pampananalaping pahayag]
 17+&lt;/small&gt;
 18+&lt;/div&gt;
 19+</root>
\ No newline at end of file
Property changes on: trunk/phase3/tests/parser/preprocess/Fundraising.expected
___________________________________________________________________
Added: svn:eol-style
120 + native
Index: trunk/extensions/NativePreprocessor/preprocesstoobj.c
@@ -189,7 +189,7 @@
190190
191191 #define getFlags() \
192192 inHeading = (parentNode->type == heading_node); \
193 - findPipe = (parentNode->type != heading_node) && (parentNode->type != bracket_node); \
 193+ findPipe = (parentNode->type != heading_node) && (parentNode->type != bracket_node) && (parentNode->type != root_node); \
194194 findEquals = findPipe && ( parentNode->nextSibling > 0 ) && ( parentNode->type != value_node );
195195
196196 while ( true ) {

Status & tagging log