You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like replace all as by zs in regular text, i.e., outside code and link targets. I've tried
importmistunefrommistune.renderers.markdownimportMarkdownRendererclassMyRenderer(MarkdownRenderer):
deftext(self, token, state):
out=self.render_children(token, state)
# if self.in_code_block:# return textreturnout.replace('a', 'z')
content="""## aa b c `a` and ``a b`` or [a](https://a.com)```basha + b = c```THE aND"""format_markdown=mistune.create_markdown(renderer=MyRenderer())
out=format_markdown(content)
print(out)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like replace all
a
s byz
s in regular text, i.e., outside code and link targets. I've triedbut this gives
Any hints?
Beta Was this translation helpful? Give feedback.
All reactions