Subject: Re: bug#48078: Verbatim environments with key-value arguments
From: Tassilo Horn <[email-masked]>
To: Dario Gjorgjevski <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Wed, 28 Apr 2021 20:41:16 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Dario Gjorgjevski <[email-masked]> writes:

Hi Dario,

> \begin{tcblisting}{%
> listing only,%
> title={Example shell session},
> minted language=shell-session,%
> minted options={},%
> }
> $ echo 'Hello, World!'
> Hello, World!
> \end{tcblisting}
>
> Feel free to add "tcblisting" to `LaTeX-verbtaim-environments' and
> check out the example above: You will see that everything after
> title={Example shell session} is fontified as verbatim.
>
> I would be happy to try and improve the regex so that it handles
> key-value arguments,

To handle all situations correctly is impossible.  You can't properly
match nested constructs like balanced parens/braces using regular
expressions.  For that, you'd need an actual parser.

But you can at least allow a fixed number of balanced braces, and I've
just done that in order to allow one level of nested {...} in mandatory
arguments.  (We already allowed for one level of nested brackets in an
optional argument.)

I'll make a new ELPA release.

Thanks for the report and Bye,
Tassilo