Hi Asiri, On Nov 5, 2008, at 9:48 AM, Asiri Rathnayake wrote:
On Wed, Nov 5, 2008 at 1:58 PM, Vincent Massol <[email protected]> wrote:
On Nov 5, 2008, at 6:32 AM, asiri (SVN) wrote:
Author: asiri Date: 2008-11-05 06:32:43 +0100 (Wed, 05 Nov 2008) New Revision: 13965
Added: sandbox/xwiki-plugin-officeimporter/src/main/java/com/xpn/xwiki/ plugin/officeimporter/filter/ImgToWikiFilter.java Removed: sandbox/xwiki-plugin-officeimporter/src/main/java/com/xpn/xwiki/ plugin/officeimporter/filter/ImageTagFilter.java Modified: sandbox/xwiki-plugin-officeimporter/src/main/java/com/xpn/xwiki/ plugin/officeimporter/transformer/HtmlToXWikiXhtmlTransformer.java sandbox/xwiki-plugin-officeimporter/src/test/java/com/xpn/xwiki/ plugin/officeconverter/HtmlFilterTest.java Log: Renamed the ImageTagFilter as ImgToWikiFilter to make more sense. This filter is only used with xhtml rendering.
Funnily I don't understand what ImgToWikiFilter means whereas ImageTagFilter is very expressive to me (it performs some filtering on image tags). I don't understand what an image to wiki means.
Well, I meant converting <img> tags into corresponding wiki syntax.
This is not wiki syntax it's a mix of XHTML and Wiki Syntax 1.0.
Which is what it was doing (i didn't touch it, I swear).
Also I don't understand why we need this filter since it converts to XWiki Syntax 1.0 which we're not supporting.
This is required only for xhtml rendering (not xwiki 2.0 import).
This is not correct since XHTML is not related to XWiki syntax 1.0 or 2.0. If you define a page as using XHTML 1.0 syntax then this won't work.
Because image links such as <img src="foo.jpg"/> which results from Office-
Html conversion doesn't mean anything on a wiki page.
Right and they should be converted to the following (that's what I was telling you yesterday): <p><!--startimage:foo.jpg--><img src="/xwiki/bin/download/currentdoc/ foo.jpg"/><!--stopimage--> This will work in XHTML 1.0 syntax.
So, what we do is,
1. Attach foo.jpg into the current document as an attachment.
2. Replace the <img> tag with quivalent wiki syntax to make it work.
An alternative would be to keep the <img> tag as it is and change the src attribute to the url of the image attachment.
Yes this is the right way, see above. Thanks -Vincent