Re: [xwiki-users] Syntax problem 1.0 -> 2.0
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
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 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. ----- hel. [email protected] -- View this message in context: http://n2.nabble.com/Syntax-problem-1.0--%3E-2.0-tp2430693p2436954.html Sent from the XWiki- Users mailing list archive at Nabble.com.
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 ....). 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 [email protected] http://lists.xwiki.org/mailman/listinfo/users
----- semantic-web.hel.at [email protected] -- View this message in context: http://n2.nabble.com/Syntax-problem-1.0--%3E-2.0-tp2430693p3458709.html Sent from the XWiki- Users mailing list archive at Nabble.com.
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 ____________
participants (2)
-
hel-o -
Vincent Massol