Hi all!

I like using the Text (Wiki-like) editing mode. This allows to make a 
code block like this:

--code
put your Java / C / PHP code here
----

I tried to paste some Java code, but the Wiki processor does not seem to 
surrount the pasted code with a CDATA tag as the XML parser complained 
that my Java code was syntactically incorrect when read as XML.

So I tried:

--code
<![CDATA[
put your Java / C / PHP code here
]]>
----

instead, which worked somewhat better, though this is a quite insane 
mixup of Text/Wiki and literal XML notation.

The problem which remains is that special characters such as quotes 
which are in the programm code are being escaped when saved. So

--code
<![CDATA[
System.out.println("Hello World");
]]>
----

becomes

--code
<![CDATA[
System.out.println(\"Hello World\");
]]>
----

Even worse, when I edit and save it again, I get

--code
<![CDATA[
System.out.println(\\"Hello World\\");
]]>
----

My suggestion would be:

- Automatically wrap the code in between --code and ---- in a CDATA.
- Look at the escape logic.

I am happy to do that and submit a patch if

a) anyone (Dashamir?) agrees this is the way
b) someone might give me a hint what pieces of code I would have to look at.

In other words: Where's the Text (Wiki) processor?

Regards,
Torsten

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Doc-book-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doc-book-users

Reply via email to