On Wed, Sep 9, 2009 at 13:06, Vincent Massol<vincent(a)massol.net> wrote:
On Sep 9, 2009, at 1:00 PM, tmortagne (SVN) wrote:
Author: tmortagne
Date: 2009-09-09 13:00:18 +0200 (Wed, 09 Sep 2009)
New Revision: 23373
Modified:
platform/core/trunk/xwiki-rendering/xwiki-rendering-api/src/main/
java/org/xwiki/rendering/internal/renderer/xwiki/
XWikiSyntaxChainingRenderer.java
platform/core/trunk/xwiki-rendering/xwiki-rendering-tests/src/test/
resources/link/links6.test
Log:
XWIKI-4294: xhtml renderer wrong escape reference in the startlink
html comment
XWIKI-4194: Inconsistent behavior when escaping "-" symbols
* improve a little escaping in links labels (less useless escaping)
Modified: platform/core/trunk/xwiki-rendering/xwiki-rendering-api/
src/main/java/org/xwiki/rendering/internal/renderer/xwiki/
XWikiSyntaxChainingRenderer.java
===================================================================
--- platform/core/trunk/xwiki-rendering/xwiki-rendering-api/src/main/
java/org/xwiki/rendering/internal/renderer/xwiki/
XWikiSyntaxChainingRenderer.java 2009-09-09 10:53:09 UTC (rev 23372)
+++ platform/core/trunk/xwiki-rendering/xwiki-rendering-api/src/main/
java/org/xwiki/rendering/internal/renderer/xwiki/
XWikiSyntaxChainingRenderer.java 2009-09-09 11:00:18 UTC (rev 23373)
@@ -760,13 +760,6 @@
@Override
public void onImage(Image image, boolean isFreeStandingURI,
Map<String, String> parameters)
{
- // Flush test content before the link.
- // TODO: improve the block state renderer to be able to
make the difference between what is bufferized
- // before the link and what in the label link
- getXWikiPrinter().setBeforeLink(true);
- getXWikiPrinter().flush();
- getXWikiPrinter().setBeforeLink(false);
-
Link link = new Link();
link.setReference("image:" +
getImageRenderer().renderImage(image));
link.setType(LinkType.URI);
Modified: platform/core/trunk/xwiki-rendering/xwiki-rendering-tests/
src/test/resources/link/links6.test
===================================================================
--- platform/core/trunk/xwiki-rendering/xwiki-rendering-tests/src/
test/resources/link/links6.test 2009-09-09 10:53:09 UTC (rev 23372)
+++ platform/core/trunk/xwiki-rendering/xwiki-rendering-tests/src/
test/resources/link/links6.test 2009-09-09 11:00:18 UTC (rev 23373)
@@ -55,7 +55,7 @@
[[Label>Reference]]
[[Reference|Param=Value]]
[[[[no link]]>>Reference]]
-[[~[~[image:whatever>>Reference]]
+[[~~[~~[image:whatever>>Reference]]
ah less great...
Why did you have to change it back from the previous commit?
Because it was not right from generic rendering POV: [[ as char are
escaped in case we have ]] as chars latter or a link, because of the
double pass if you escape it just once you risk to break something in
the label itself, for example if you have:
<a href="reference">[[ <img with="100"/></a>
you need to escape twice the [[ for it to break the following image
and parsed back.
[[~~[~~[ [[image:whatever||with=100]]>>reference]]
if you escape only one the first [[ the sub link syntax will start at
this point instead of starting at second [[
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne