Tips Collection #6
pilgrimlyieu
started this conversation in
Show and tell
Replies: 1 comment
-
tip.common.0001
Because of the confusing behavior of Python Regex, For instance Snippets/markdown/text_shortmath.snippets Lines 21 to 24 in 8593cbd
would not expand the snippet. According to Python re doc, the solution is to add For the above example is (?a)(\D?)\bce context "text()"
-snippet "\b(\D?)ce" "行间化学 Inline Chemical" r
+snippet "(?a)(\D?)\bce" "行间化学 Inline Chemical" r
`!p snip.rv = match.group(1) + ('' if match.group(1) in before_puncs else ' ')`$\ce{${1:${VISUAL}}}$ $0
endsnippet
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Collection of useful & constructive tips.
Beta Was this translation helpful? Give feedback.
All reactions