Syntax problem 1.0 -> 2.0

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax problem 1.0 -> 2.0

hel-o
Hi,

sometime ago the old Wysiwyg (1.0) started to create wrong heading syntax. e.g.

Heading 2

  instead of
1.1 Heading 2

I thought i started a thread for that but i can't find it so ... some problem related to that are, stylesheets not working, toc-macro not working ...

I thought that would stop beeing a problem with the change to the new Wysiwyg (2.0) in fakt it is when you create pages in the new syntax but i just found that when you create a page in the old syntax and change it zu 2.0 the conversion does this:

{{html wiki="true"}}

Heading 2

{{/html}}

That on one hand mayby correct handling of such conversions but since the syntax is not intended to be that way i think it's not so good.

The conversion of "1.1 Heading 2" works fine by the way.

hel.


semantic-web.hel.at
hel@hel.at
Reply | Threaded
Open this post in threaded view
|

Re: Syntax problem 1.0 -> 2.0

vmassol
Administrator
Hi Hel,

On Thu, Mar 5, 2009 at 6:04 PM, hel-o <[hidden email]> wrote:

>
> Hi,
>
> sometime ago the old Wysiwyg (1.0) started to create wrong heading syntax.
> e.g.
>
> <h2>Heading 2</h2>
> instead of
> 1.1 Heading 2
>
> I thought i started a thread for that but i can't find it so ... some
> problem related to that are, stylesheets not working, toc-macro not working
> ...
>
> I thought that would stop beeing a problem with the change to the new
> Wysiwyg (2.0) in fakt it is when you create pages in the new syntax but i
> just found that when you create a page in the old syntax and change it zu
> 2.0 the conversion does this:
>
> {{html wiki="true"}}<h2>Heading 2</h2>{{/html}}
>
> That on one hand mayby correct handling of such conversions but since the
> syntax is not intended to be that way i think it's not so good.
>
> The conversion of "1.1 Heading 2" works fine by the way.

I don't know if there's much we can do here since the tinymce-based
wysiwyg will have saved the content of the page in HTML in your case
and the converter cannot distinguish this from someone typing HTML in
the page.

If you have an idea of how to do it let us know. For me you'll need to
correct the 1.0 content for your pages that have this problem.

Thanks
-Vincent
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Syntax problem 1.0 -> 2.0

vmassol
Administrator
In reply to this post by hel-o
Hi,

On Mar 6, 2009, at 11:02 AM, Helmut Lehner wrote:

> Hi Vincent
>
>> I don't know if there's much we can do here since the tinymce-based
>> wysiwyg will have saved the content of the page in HTML in your case
>> and the converter cannot distinguish this from someone typing HTML in
>> the page.
>
> I get this code editing a page in WYSIWYG-Mode with Syntax 1.0 and  
> only the headings are html. The rest is wiki syntax. This behavior  
> started somwhere around Version 1.5 i think. before headings were  
> created correctly in wiki syntax (as the rest).
>
>
>> If you have an idea of how to do it let us know. For me you'll need  
>> to
>> correct the 1.0 content for your pages that have this problem.
>
> I know how to correct this i just wanted to mention that this could  
> be a problem not only for me but for every user who creates pages in  
> syntax 1.0 in WYSIWYG and converts them to syntax 2.0 afterwards.

Yes it's a problem. One thing that can be done is to write/provide a  
small velocity/groovy script that scans all wiki pages and replaces  
the heading with the wiki syntax.

> The best thing would be to make the tiny mce editor create headings  
> again in wiki syntax:)

That will not solve the problem for all page contents which have now  
HTML for headings.

> The next best thing would be to convert html headings  like the ones  
> created (without class, or style information) to headings in xwiki  
> syntax 2.0 because i think there are fewer headings created  
> intentionally in html with that code than by accident through that  
> editor bug.

I think I'd prefer the script solution since otherwise that'll make  
the converter heavier and with some hacks.

WDYT?

Thanks
-Vincent
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Syntax problem 1.0 -> 2.0

hel-o
Hi,

vmassol wrote
Hi,

Yes it's a problem. One thing that can be done is to write/provide a  
small velocity/groovy script that scans all wiki pages and replaces  
the heading with the wiki syntax.
That would be great for all existing pages with the wrong syntax.

vmassol wrote
> The best thing would be to make the tiny mce editor create headings  
> again in wiki syntax:)

That will not solve the problem for all page contents which have now  
HTML for headings.
As long as both syntax can be used (both wysiwygs are available) someone will be able to create that scenario. I don't know if the plan is to remove the tiny mce wysiwyg then its no problem. (just wanted to mention that:)

vmassol wrote
> The next best thing would be to convert html headings  like the ones  
> created (without class, or style information) to headings in xwiki  
> syntax 2.0 because i think there are fewer headings created  
> intentionally in html with that code than by accident through that  
> editor bug.

I think I'd prefer the script solution since otherwise that'll make  
the converter heavier and with some hacks.

WDYT?
I also don't think the second option is not a good one. As i said the script would be great for existing pages. But as long as the tiny mce editor has this bug and is available ... you know what i mean

Thanks
hel.
semantic-web.hel.at
hel@hel.at
Reply | Threaded
Open this post in threaded view
|

Re: Syntax problem 1.0 -> 2.0

hel-o
In reply to this post by vmassol
Hi,

just wanted to know if theres a script available replacing wrong heading syntax (

 

...

 ...) with wiki syntax (1 ... 1.1.1 ....).

We are switching to syntax 2.0 and we want to convert the old pages to the new syntax.

Thanks
hel.

vmassol wrote
Hi,

On Mar 6, 2009, at 11:02 AM, Helmut Lehner wrote:

> Hi Vincent
>
>> I don't know if there's much we can do here since the tinymce-based
>> wysiwyg will have saved the content of the page in HTML in your case
>> and the converter cannot distinguish this from someone typing HTML in
>> the page.
>
> I get this code editing a page in WYSIWYG-Mode with Syntax 1.0 and  
> only the headings are html. The rest is wiki syntax. This behavior  
> started somwhere around Version 1.5 i think. before headings were  
> created correctly in wiki syntax (as the rest).
>
>
>> If you have an idea of how to do it let us know. For me you'll need  
>> to
>> correct the 1.0 content for your pages that have this problem.
>
> I know how to correct this i just wanted to mention that this could  
> be a problem not only for me but for every user who creates pages in  
> syntax 1.0 in WYSIWYG and converts them to syntax 2.0 afterwards.

Yes it's a problem. One thing that can be done is to write/provide a  
small velocity/groovy script that scans all wiki pages and replaces  
the heading with the wiki syntax.

> The best thing would be to make the tiny mce editor create headings  
> again in wiki syntax:)

That will not solve the problem for all page contents which have now  
HTML for headings.

> The next best thing would be to convert html headings  like the ones  
> created (without class, or style information) to headings in xwiki  
> syntax 2.0 because i think there are fewer headings created  
> intentionally in html with that code than by accident through that  
> editor bug.

I think I'd prefer the script solution since otherwise that'll make  
the converter heavier and with some hacks.

WDYT?

Thanks
-Vincent
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
semantic-web.hel.at
hel@hel.at
Reply | Threaded
Open this post in threaded view
|

Re: Syntax problem 1.0 -> 2.0

vmassol
Administrator
Hi Hel-o,

On Aug 17, 2009, at 2:50 PM, hel-o wrote:

>
> Hi,
>
> just wanted to know if theres a script available replacing wrong  
> heading
> syntax (<h1> </h1>... <h3></h3> ...) with wiki syntax (1 ...  
> 1.1.1 ....).

Note that 1, 1.1, etc are xwiki syntax 1.0 and not 2.0. For 2.0 it's  
=, ==, ===, etc.

> We are switching to syntax 2.0 and we want to convert the old pages  
> to the
> new syntax.

Nobody has written such a script but it shouldn't be too hard to write  
it if you want. Something along the lines of:

Pattern pattern = Pattern.compile("<h([1-6])>(.*)</h[1-6]>");
Matcher matcher = pattern.matcher($mydoc.content());
// perform replacements using Matcher api here

$mydoc.setContent(modifiedcontent)
$mydoc.save(...)

You could even use grooy regex support:
http://groovy.codehaus.org/Regular+Expressions

Thanks
-Vincent

> vmassol wrote:
>>
>> Hi,
>>
>> On Mar 6, 2009, at 11:02 AM, Helmut Lehner wrote:
>>
>>> Hi Vincent
>>>
>>>> I don't know if there's much we can do here since the tinymce-based
>>>> wysiwyg will have saved the content of the page in HTML in your  
>>>> case
>>>> and the converter cannot distinguish this from someone typing  
>>>> HTML in
>>>> the page.
>>>
>>> I get this code editing a page in WYSIWYG-Mode with Syntax 1.0 and
>>> only the headings are html. The rest is wiki syntax. This behavior
>>> started somwhere around Version 1.5 i think. before headings were
>>> created correctly in wiki syntax (as the rest).
>>>
>>>
>>>> If you have an idea of how to do it let us know. For me you'll need
>>>> to
>>>> correct the 1.0 content for your pages that have this problem.
>>>
>>> I know how to correct this i just wanted to mention that this could
>>> be a problem not only for me but for every user who creates pages in
>>> syntax 1.0 in WYSIWYG and converts them to syntax 2.0 afterwards.
>>
>> Yes it's a problem. One thing that can be done is to write/provide a
>> small velocity/groovy script that scans all wiki pages and replaces
>> the heading with the wiki syntax.
>>
>>> The best thing would be to make the tiny mce editor create headings
>>> again in wiki syntax:)
>>
>> That will not solve the problem for all page contents which have now
>> HTML for headings.
>>
>>> The next best thing would be to convert html headings  like the ones
>>> created (without class, or style information) to headings in xwiki
>>> syntax 2.0 because i think there are fewer headings created
>>> intentionally in html with that code than by accident through that
>>> editor bug.
>>
>> I think I'd prefer the script solution since otherwise that'll make
>> the converter heavier and with some hacks.
>>
>> WDYT?
>>
>> Thanks
>> -Vincent
>> ____________
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users