Re: CDATA in source comments



On Tue, 2004-11-23 at 14:32 +0100, Stefan Kost wrote:
> Hi Matthias,
> 
> thats what I was thinking, but it does not. Using:
> /**
>   * ...
>   * <informalexample><programlisting>
>   * g_object_get(bla,"peng",&peng);
>   * </programlisting>
>   * </informalexample>
>   */
> 
> produces an parser error abount an EntityRef that needs to be compleeted by a
> ';' - means the '&' infront of 'peng' is not escaped to become '&amp;'.
> Thats my I was trying to use a CDATA section 9to avoid manually escaping all the
>  special chars.
> 

Ah, I got it wrong. If markup in comments is enabled it does *not*
escape & < > (thinking about it, that is as it has to be). I don't think
adding support for marked sections is the right thing. If we want to
avoid markup in cases like this, we could try to come up with a new 
shorthand notation for examples in comments. Something like

/**
 * ...
 * bla bla bla 
 * bla bla bla
 *
 * ----
 * g_object_get (bla, "peng", &peng);
 * ----
 *
 * more bla bla 
 * ...
 */

But I'm not 100% convinced this is a good idea either.

Matthias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]