Hi Juan!
I'm happily surprised to see how fast you have answered! Thanks a lot for paying attention to my issue and also thanks for the welcoming!
First I need to mention that i am using tiny_mce as an editor, with the syntaxhl plugin for syntax highlightning. This solution was very satisfying when we tried to create new blogs on our portal. The syntaxhl tags generated look like this :
1<div class=\"entry-body\">
2<pre><pre class=\"brush: java; fontsize: 100; first-line: 1; class-name:default\">
3Some java code goes here
4</pre></pre>
5</div>
for the Java language, for example.
And as you already know, the code we may find in an xml file generated by a WordPress export looks like this :
1[cc language=java]
2Some java code goes here
3 [/cce]
I could have transformed the xml file with regex, but the problem is also that the WordPress Importer, during the import, generates <p></p> tags in the code parts (which are not effective : the visitor can see them and no "\n" is operated). Thus I found no other solution but to transform the code once imported. (which shall not be harder).
My program does the following :
- it connects to the lportal database, looks for the blogsentry table
- it gets all the articles the table may contain
- it converts all the tags using some regular expressions
- it removes the <p> tags and turns the </p> tags into "\n"
- and finaly, it persists the articles back.
The program should be easily understandable, but i said it was "heavy" because all after these spent efforts I just asked myself "is there no Liferay editor able to understand those tags?". And if such an editor does exist, my program is useless.
If you think my solution is viable and relevant, I would be happy to share it.
Thanks for helping!
Gaël
Please sign in to flag this as inappropriate.