Hi Vincent,

On Fri, Aug 15, 2008 at 3:12 PM, Vincent Massol <[EMAIL PROTECTED]> wrote:
> Hi Wang,
>
> On Aug 15, 2008, at 7:05 AM, Wang Ning wrote:
>
>> Hi, Vincent
>>
>> I test the xhtml parser. There is the focus:
>> 1. base text format
>> underline. I think you can fix it.
>
> see http://code.google.com/p/wikimodel/issues/detail?id=31
>
> Now we need to submit a patch or wait till it's fixed.
>
I think I fix it in my machine, but I modify a several class in both
xwiki-core-rendering and org.wikimodel.wem. The following is my steps:
for xwiki-core-rendering-api
1. add UnderlineBlock in org.xwiki.rendering.block. just like BoldBlock
2. add beginUnderline() and endUnderline() in Listener interface.
3. implement this two new methods in all the implement classes, etc
ListenerDelegate, XWikiSyntaxRenderer, XHTMLRenderer

for xwiki-core-rendering-wikimodel
1. modify endFormat(WikiFormat format) in XDOMGeneratorListener.java
add  a else-if for underline format

for wikimodel
1. add public static final WikiStyle UNDERLINE = new WikiStyle("u");
in IWemConstants.java
2. XhtmlHandler need to be add a taghandler for underline in TagStack

I have test it. It works fine. And I think we can add <del> <sup>
<sub> support in the same way.
But I found that <u> is deprecated in xhtml.  So, do we need support it?

Furthermore, As I just want to fix the xhtml parser in wikimodel and
WikiModelXHTMLParser so that the xhtml can convert to xdom then to
xwiki syntax, so I think I just only need to modify the XhtmlHandler
in wikimodel. I don't understand how XWikiScanner.jj works and I think
it is for the generation for xwiki syntax to wikimodel, right?

Should I submit my patch to wikimodel and xwiki-core-rending?

>> 2. List
>> both number and bulleted.
>> The problem is in wikimodel xhtmlparser. It don't parser nested list
>> correctly. I think it hard to fix but I will try my best.
>
> See http://code.google.com/p/wikimodel/issues/detail?id=22&can=4
>
> I need to update our version of wikimodel to latest from wikimodel
> trunk since I think something related to lists has been fixed. I'll do
> that later today.
>
I use the latest version fo wikimodel. And as you said in the
issues-22, list items and lists are closed when they shouldn't.

> Otherwise we need to submit a patch or wait.
>
I think this is a little hard for me to fix it, but I will try.
>> 3. Link
>> For input <html><body><a
>> href=\"http://xwiki.org\";>xwiki</a></body></html>, the xhtmlparser
>> generate
>> beginDocument()
>>    beginParagraph([])
>>        beginFormat([])
>> xwiki<http://xwiki.org>        endFormat([])
>>    endParagraph([])
>> endDocument()
>>
>> I use XhtmlParser and EventDumpListener.
>> But the WikiModelXHTMLParser don't handle the event. Maybe
>> XDOMGeneratorListener have some problem to generate link block. Any
>> suggestion about this? Thanks.
>
> Don't know. Would need to look.
>
>> 4. table
>> Xhtmlparser can generate table event, but XDOMGeneratorListener don't
>> handle the event correctly. Is it not finished?
>
> Yes tables in xwiki is done using a table macro which is not
> implemented yet.
>
> I'll ask Thomas if that's something he could work on in priority (he's
> started the code macro but this is even more important, I had
> forgotten about it).
>
>> 5. img
>> Xhtmlparser just ignore the <img> tag. But it's OK since I use
>> imagetagfilter to handle the <img>
>
> Then we need to report an issue against the XHTML parser.
I did it yesterday ;)
>
>> 6. param of text
>> like <p align="center">text</p>. how to handle the algin parameter?
>
> I think we should use only "style" parameter and then talk with
> wikimodel to support it somehow.
>
>> I think, if the problem above can be fixed, xhtmlparser will work for
>> conversion from xhtml to xwiki syntax.
>
PS: If I add some test case in xwiki-core-rendering-tests for
underline <del> <sup> <sub> or <img> <link>, how should I submit the
new testcast to the svn?
Do I need to create a issue and attach the test case as patch? Or some way else?
> ok.
>
> Thanks
> -Vincent
-- 
Thanks
Wang Ning
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to