On Nov 18, 2008, at 1:00 PM, Vincent Massol wrote: > > On Nov 18, 2008, at 12:42 PM, Sergiu Dumitriu wrote: > > [snip] > >> Vincent Massol wrote: >>> On Nov 18, 2008, at 10:54 AM, Sergiu Dumitriu wrote: >>> >>>> Vincent Massol wrote: >>>>> Hi, >>>>> >>>>> On Nov 18, 2008, at 6:04 AM, Asiri Rathnayake wrote: >>>>> >>>>>> Hi Guillaume, >>>>>> >>>>>> On Mon, Nov 17, 2008 at 7:55 PM, Guillaume Lerouge <[EMAIL PROTECTED] >>>>>>> wrote: >>>>>>> Hi Asiri, >>>>>>> >>>>>>> I just tested it and got an exception: >>>>>>> http://91.121.237.216/xwiki/bin/view/Test/WikiDeveloppeurs >>>>>>> >>>>>>> I can send you the original file if you wish. Could the >>>>>>> exception >>>>>>> be >>>>>>> related >>>>>>> to the presence of bulleted lists in the original document? I >>>>>>> checked the >>>>>>> JIRA issue related to lists but it didn't seem to be the same >>>>>>> one. >>>>>>> >>>>>>> >>>>>> It's the following content that is causing the exception to be >>>>>> thrown : >>>>>> >>>>>> Par exemple:*#if($context.user == «XWiki.Admin»)Vous êtes >>>>>> l'administrateur >>>>>> par défaut de ce wiki!#else Vous êtes un utilisateur >>>>>> classique.#end* >>>>> [snip] >>>>> >>>>>> The issue here is that the rendering mechanism thinks >>>>>> "exemple://#if($context.user >>>>>> ...." is a url and tries to parse it... >>>>>> >>>>>> I think this is something that has to be handled in the rendering >>>>>> module. >>>>>> We'll wait for vincent's opinion on this. >>>>> First, a comment: >>>>> * I'm currently working on error handling and this error will be >>>>> reported inline with an ErrorBlock and thus with a visual error >>>>> where >>>>> it happened in the very near future. >>>>> >>>>> The format for an inline link is (scheme):(something) >>>>> >>>>> However for URIs, only some are considered valid: mailto, image, >>>>> attach >>>>> For URL (i.e of the form (scheme)://(something) there's no check >>>>> currently and all are considered URLs and checked to be valid. >>>>> >>>>> The reason we don't check for validity is because there can be any >>>>> number of valid URL schemes (for example skype:// is a valid >>>>> scheme >>>>> if >>>>> you've registered skype URL in your browser). >>>>> >>>>> I don't see any solution for this except not allowing inline links >>>>> but >>>>> I'm not sure this is a good solution. >>>>> >>>>> I think the inline error handling is the best solution and the >>>>> user >>>>> will use {{{exemple://#if($context.user..}}} if we really wants to >>>>> enter this text. >>>>> >>>>> WDYT? >>>> We should not try to let through every URL, but just a few we are >>>> sure >>>> are working: http, https, ftp, mailto. For the others, there's >>>> always >>>> copy/paste. >>> >>> I don't quite agree. >>> >>> I should be able to enter a skype URL for example and since you can >>> register any type of URL in your browser we can't filter them. >>> >>> What we could do though is test for the URL validity and if not >>> valid >>> then don't consider the element as a link. That is not very easy to >>> implement but possible. I'm not sure I prefer this over displaying >>> an >>> inline error. >>> >> >> Well, this time the user didn't do anything wrong. > > I don't agree. He did not follow the defined wiki syntax so he did > something wrong and we need to tell him/her. > >> It just happened that >> the document contained an italic text after ':'. He will see the >> error >> and think that XWiki is faulty, not that he did something wrong. I >> certainly wouldn't like to receive such an error after importing a >> "simple" document. > > The import is a different matter. I was talking about the wiki > syntax here. For the import I don't understand since you'll never > get a link if you the original document didn't have a <a href=""> > element so this can't happen since it'll be considered as text.
Ok I understand now. It's imported as text and saved in wiki syntax as normal text. When rendered later in XHTML it's parsed again and then this time considered an inline element and rendered accordingly. So the real solution is that the XHTML parser should either generate a verbatim block event or simply escape the ":" with "\:". I'll add a unit test for this to see how it goes. Thanks -Vincent _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

