Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -879,24 +879,31 @@ |
880 | 880 | |
881 | 881 | nowiki |
882 | 882 | = "<nowiki>" nc:nowiki_content "</nowiki>" { |
883 | | - // console.log(pp(nc)); |
| 883 | + //console.log( 'full nowiki return: ' + pp(nc)); |
884 | 884 | return nc; |
885 | 885 | } |
886 | 886 | / "<nowiki>" { |
887 | 887 | //console.log('nowiki fallback'); |
888 | 888 | return ['<nowiki>']; |
889 | 889 | } |
890 | | - / "</nowiki>" { return ['</nowiki>']; } |
| 890 | + / "</nowiki>" { |
| 891 | + //console.log('nowiki end fallback'); |
| 892 | + return ['</nowiki>']; |
| 893 | + } |
891 | 894 | |
892 | 895 | nowiki_content |
893 | 896 | = ts:( t:[^<]+ { return t.join('') } |
894 | 897 | / "<pre" p0:space* p1:[^>]* ">" p2:nowiki_content "</pre>" { |
895 | 898 | //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(''); |
897 | 900 | } |
898 | | - / (!("</nowiki>" / "</pre>") c:. {return c}) |
| 901 | + / (!("</"( "nowiki>" / "pre>")) c:. { |
| 902 | + //console.log('nowiki: single char' + c); |
| 903 | + return c; |
| 904 | + }) |
899 | 905 | )* { |
900 | 906 | // return nowiki tags as well? |
| 907 | + //console.log('nowiki_content: return' + pp(ts)); |
901 | 908 | return [ts.join('')]; |
902 | 909 | } |
903 | 910 | |