r110657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110656‎ | r110657 | r110658 >
Date:13:10, 3 February 2012
Author:gwicke
Status:deferred
Tags:
Comment:
Fix nowiki tokenization regression introduced r110495
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
@@ -879,24 +879,31 @@
880880
881881 nowiki
882882 = "<nowiki>" nc:nowiki_content "</nowiki>" {
883 - // console.log(pp(nc));
 883+ //console.log( 'full nowiki return: ' + pp(nc));
884884 return nc;
885885 }
886886 / "<nowiki>" {
887887 //console.log('nowiki fallback');
888888 return ['<nowiki>'];
889889 }
890 - / "</nowiki>" { return ['</nowiki>']; }
 890+ / "</nowiki>" {
 891+ //console.log('nowiki end fallback');
 892+ return ['</nowiki>'];
 893+ }
891894
892895 nowiki_content
893896 = ts:( t:[^<]+ { return t.join('') }
894897 / "<pre" p0:space* p1:[^>]* ">" p2:nowiki_content "</pre>" {
895898 //console.log('nested pre in nowiki');
896 - return ["<pre"].concat(p0, p1, [">"], [p2[0].value], ["</pre>"]).join('');
 899+ return ["<pre"].concat(p0, p1, [">"], p2, ["</pre>"]).join('');
897900 }
898 - / (!("</nowiki>" / "</pre>") c:. {return c})
 901+ / (!("</"( "nowiki>" / "pre>")) c:. {
 902+ //console.log('nowiki: single char' + c);
 903+ return c;
 904+ })
899905 )* {
900906 // return nowiki tags as well?
 907+ //console.log('nowiki_content: return' + pp(ts));
901908 return [ts.join('')];
902909 }
903910

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110495Change token format to plain strings for text tokens, and specific objects for...gwicke16:30, 1 February 2012

Status & tagging log