-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add required output_block_math(); add synopsis #26
base: master
Are you sure you want to change the base?
Conversation
mistune_contrib/math.py
Outdated
return '$%s$' % text | ||
# override with customized math rendering | ||
return '$ this is my math: %s$' % text | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create a test case for it. Don't add the tests here.
Well, another issue is that the following codes in
Where
|
In order to let the test for math to pass, this pr must be applied first: lepture/mistune#185 |
hi @lepture what do think about these tests I provided in the last commit? 😃 |
But, please remove the code under |
I added these code as a complete guide of how to use I did spend some time figuring out how to use it. I'd like these sample codes would save other's time. If it is not appropriate leaving it in the if-main block, what's your suggestion about where to have it? |
It is better in the doc strings. currently, mistune is hard to extend. I'm working on mistune 2.0 which is easier to write plugins. |
OK that |
Cause:
I found that it does not render block math.
The complain is about a missing function
output_block_math()
which is required by aMarkdown
instance.My solution:
Thus I added a
output_block_math()
in aMarkdown
sub class.Explain:
From the
mistune.py
I see thatCustomized inline lexer rendering functions are meant to be defined in a sub class of Renderer. But block level lexer rendering functions must be defined in a sub class of
Markdown
.I do not know if I missed anything about the entire workflow or if there is another elegant way to fix it.
In order to let tests pass, lepture/mistune#185 must be applied first.
BTW.
mistune
is such a great work that saved me a lot time processing my own markdowns. 👍👍