Vincent Massol wrote:
> Hi,
> 
> After discussing with Thomas we've reached the conclusion that we  
> should change the way the HTML macro handle its content when wiki=true.
> For ex take the following input:
> 
> {{velocity}}
> ...
> {{html wiki="true"}}
> <form>
> $xwiki.includeForm("XWiki.MyClassSheet")
> <br />
> <p>
> <input type="submit" name="submit" value="Create this new  
> Workpackage" />
> </p>
> </form>
> {{/html}}
> ...
> {{/velocity}}
> 
> And assume that MyClassSheet has some $doc.display() velocity code  
> which thus generate {{html}} macros.
> 
> Current Result
> ============
> 
> Right now here's what happens:
> 1) velocity macro is executed and $xwiki.includeForm executes
> 2) MyClassSheet generate {{html}} macro content thus yielding:
> 
> {{html wiki="true"}}
> <form>
> {{html}}...<someTag>...</someTag>{{/html}}
> </form>
> {{/html}}
> 
> 3) After velocity has finished executing the velocity macro calls the  
> wiki parser on the result and thus the top level HTML macro executes
> 4) since wiki=true the content is given to a SAX parser and each XML  
> tag content is given to the wiki parser. Thus "{{html}}...", "..." and  
> "{{/html}}"  will be parser by the wiki parser separately (because  
> <someTag> is valid XML), thus generating non expected content as a  
> result.
> 
> Proposed change
> ==============
> 
> Modify the HTML behavior so that the wiki parser executes first  
> (instead of the SAX parser) and render the result using a special  
> renderer that prints the special symbols and text as is.
> 
> When run on our example this would give (same steps 1) and 2)):
> 
> 3) wiki parser executes and generate XDOM. Render it using the special  
> renderer
> 
> Note that this means that if in HTML your write content that has a  
> meaning in some wiki syntax you'll need to escape it. For example if  
> you have:
> 
> {{html wiki=true}}
> <!--hello-->
> {{/html}}
> 
> you'll get some strikethrough. So you'll need to write instead:
> 
> {{html wiki=true}}
> <!~-~-hello~-~->
> {{/html}}
> 
> WDYT?

+1

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to