Escaping

6 views
Skip to first unread message

Neil

unread,
May 31, 2010, 11:30:31 PM5/31/10
to creoleparser
I'm using creoleparser as part of a tool that converts from creole to
latex. Single dollars are used to wrap math, e.g. $12 + 34$. I don't
need to parse this (just pass it on directly to latex), but I don't
want anything inside to be parsed.

I can do this easily using NoWikiElement. But a minor issue is that an
escaped dollar, i.e. \$, does not signify the start of math mode. So
I'd like the regular expression to only match a dollar not preceded by
a \.

Is there a good way to do this? My current thought is to use another
element type to look for escaped dollars and swallow them first, but I
feel like I'm missing an easier solution.

Thanks!
Neil

shday

unread,
Jun 1, 2010, 7:21:02 PM6/1/10
to creoleparser
Hi Neil,

I think sub-classing the NoWikiElement class and over-riding the
re_string() method would be the best way. Then create a custom dialect
(I think you how to do this part already).

Sound good?

Steve
Reply all
Reply to author
Forward
0 new messages