Re: [Boost-docs] Trac syntax highlighting for QuickBook, first attempt

Subject: Re: [Boost-docs] Trac syntax highlighting for QuickBook, first attempt
From: John Maddock (john_at_[hidden])
Date: 2007-08-16 16:29:32


Kai Brüning wrote:
>> As a result,
>> - [pre .. ] does not work correctly so far.
>> - It is not possible to highlight (some) marked text differently,
>> like specifically styled text or table headers.
>>
>> * The reasons not to count the nesting are twofold:
>> - The existing Pygments lexers are mostly kept very simple, having a
>> lot less states than I created so far. I'd like to stick with this
>> style as much as possible.
>> - It would probably be hard (even impossible with regexes?) to
>> correctly track escaped markup characters. Currently I handle the
>> simple case (like \[) in most cases, but not multiple escape
>> characters (like \\[ -> markup, \\\[ -> no markup). Although unlikely
>> in practice, I do not like the idea too much to do nesting tracking
>> which can easily be broken.

Could you use lookbehind to deal with escapes, something like:

\[pre((<!=[^\\]\\)\]|[^\]])*\]

To match [pre ... ] with any \]'s included as part of the block?

Just thinking aloud here, and probably you've been all around stuff like
this already :-)

>> Questions:
>>
>> * Am I moving in the right direction?

Yep, looks good. Might be nice to have sections and headings stand out more
though (the text of the heading that is).

HTH, John.


This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC