quetzai / wikimodel

Automatically exported from code.google.com/p/wikimodel
0 stars 0 forks source link

XWikiSyntax - Macro inside macro badly parsed when the inner macro name start with the top macro name #174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
See http://jira.xwiki.org/jira/browse/XWIKI-4910

Original issue reported on code.google.com by thomas.m...@gmail.com on 17 Mar 2010 at 4:44

GoogleCodeExporter commented 8 years ago
test("{{code}}{{code1}}{{/code1}}{{/code}}");

Original comment by thomas.m...@gmail.com on 17 Mar 2010 at 4:47

GoogleCodeExporter commented 8 years ago
Here is a fix:

Index: src/main/java/org/wikimodel/wem/xwiki/xwiki20/javacc/XWikiScanner.jj
===================================================================
--- 
src/main/java/org/wikimodel/wem/xwiki/xwiki20/javacc/XWikiScanner.jj    (revision 
462)
+++ 
src/main/java/org/wikimodel/wem/xwiki/xwiki20/javacc/XWikiScanner.jj    (arbetskopi
a)
@@ -353,7 +353,7 @@
     | <MACRO_END: "{{/" <MACRO_NAME> (<SPACE>)* "}}" > {
         {
             String name = getMacroName(image); 
-            if (name.startsWith("/" + macroName)) {
+            if (name.equals("/" + macroName)) {
                 macroDepth--;
                 if (macroDepth == 0) {
                     returnFromSpecialState();

Original comment by AndreasZ...@gmail.com on 1 Apr 2010 at 1:13

GoogleCodeExporter commented 8 years ago

Original comment by thomas.m...@gmail.com on 2 Apr 2010 at 1:43

GoogleCodeExporter commented 8 years ago
Applied patch form Andreas Jonsson. Last time, you are committer now ;)

Original comment by thomas.m...@gmail.com on 2 Apr 2010 at 1:45