update: Arun's answer, below, works for me, since I'm not using syntax highlighting anyway. Thanks!
Here's my original question:
I use the following setting to allow me to mark text as bold within an lstlisting environment by putting three asterisks at the beginning and end of the bolded section:
\lstset{moredelim=[is][\bfseries]{***}{***}}
This works find most of the time, but fails when I try to use it within quoted text. For example, the following works:
\begin{lstlisting}
this is a ***test***!
\end{lstlisting}
but the following doesn't:
\begin{lstlisting}
"this is a ***test***!"
\end{lstlisting}
The second form simply prints literal asterisks. Is there a way to turn off the special behaviour of lstlisting when within quotes?
Bryan
edit: I've added a complete minimal example below.
\documentclass{article}
\usepackage{listings}
\lstset{ % Set options for ``listing'':
language=C++,
commentstyle=,
keywordstyle=,
identifierstyle=,
basicstyle=\ttfamily,
breaklines=false,
frame=,
showstringspaces=false
}
\lstset{moredelim=[is][\bfseries]{***}{***}}
\begin{document}
This works:
\begin{lstlisting}
this is a ***test***!
\end{lstlisting}
This doesn't:
\begin{lstlisting}
"this is a ***test***!"
\end{lstlisting}
\end{document}