You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Christophe Dupriez <ch...@destin.be> on 2011/02/07 14:37:04 UTC
Problem with images properties and CK Editor: QUESTIONS about XHtmlElementToWikiTranslator.java,
method printImage
Hi!
Our users are delighted by CK Editor in JSPWiki.
Few glitches remain which cause problems with saved documents.
One is with saving images in a page: CKEditor is storing image
properties as CSS in style="..." attribute.
In /src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
I find the following piece of code (around line 733 in method printImage):
map.put( "align", base.getAttributeValue( "align" ) );
map.put( "height", img.getAttributeValue( "height" ) );
map.put( "width", img.getAttributeValue( "width" ) );
map.put( "alt", img.getAttributeValue( "alt" ) );
map.put( "caption", emptyToNull( XPath.newInstance( "CAPTION"
).valueOf( base ) ) );
map.put( "link", href );
map.put( "border", img.getAttributeValue( "border" ) );
map.put( "style", base.getAttributeValue( "style" ) );
You can see that style is taken from "base" (like "align") and not from
"img". For that reason, the style attribute of the image simply
disappear in the Wiki Markup. And my users are unhappy!
What is the reasoning behind this? Should I merge "base" and "img"
attributes? Take "img" only? Or what else?
THANK YOU VERY MUCH !!!
Have a nice day!
Christophe