[NTG-context] strange colorleak in definetyping[XML]

Hans Hagen pragma at wxs.nl
Mon Jul 23 00:36:48 CEST 2007


Hans van der Meer wrote:
> I did encounter 'leaking' color outside the XML verbatim typing.
> The effect can be turned off and on by removing/placing the ':' in 
> 'file:' in the second xml-line.
> Is this a bug? It certainly is annoying that the default color is 
> inadvertently changed.
> 
> A (somewhat) minimal example follows:
> 
> ===================================================================
> \setupcolors[state=start]
> \definecolor [mistyrose] [r=1,g=.894118,b=.882353]
> 
> % Setup coloring for framed text (unbreakable) blocks.
> \defineframedtext[framedcode][frame=on,corner=round,rulethickness=2pt,
> width=\textwidth,color=codecolor,style=\ttxx,
> background=color,backgroundcolor=mistyrose,framecolor=indianred]
> 
> % Setup coloring for verbatim code fragments.
> \definecolor [codecolor] [red]
> \definecolor [colorprettyone]   [codecolor]
> \definecolor [colorprettytwo]   [codecolor]
> \definecolor [colorprettythree] [codecolor]
> \definecolor [colorprettyfour]  [codecolor]
> \setuptyping [color=codecolor,palet=colorpretty]
> % XML typesetting inside framebox with background.
> \definetyping[XMLBOX][option=XML,style=\ttxx,
> before={\bgroup\setupinterlinespace[line=2ex]\startframedcode},
> after={\stopframedcode\egroup}]
> 
> \starttext
> 
> Testing xml typing\crlf
> 
> \startXMLBOX
> <?xml version="1.0" encoding="UTF-8"?>
> <locationURI>zip:/?file////path/to/a.zip</locationURI>
> \stopXMLBOX
> 
> This color is black as it should be.
> 
> \startXMLBOX
> <?xml version="1.0" encoding="UTF-8"?>
> <locationURI>zip:/?file:////path/to/a.zip</locationURI>
> \stopXMLBOX
> 
> This color should be black not \quote{codecolor}!!!
> \stoptext

looks like an unfinished coloring state


removing the \setpretty`\: lines in the file verb-xml.tex helps


btw,


\startbuffer
<?xml version="1.0" encoding="UTF-8"?>
<locationURI oeps:oeps="x:x">zip:/?file:////path/to/a.zip</locationURI>
\stopbuffer

\showXMLbuffer

also is an option

if you want the whole verbatim to have one color, don't use option= but 
just use color=...

Hans




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list