-
Notifications
You must be signed in to change notification settings - Fork 567
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
Backwards compatibility broken on #markdown2html() #1007
Comments
Looking into this at the PyCon sprints! |
The plan is to revert this backwards incompatible change and have the next release include tl;dr - flip it and reverse it! |
I'm not sure that works, since this method is called by jinja2, please check if the argument order matters. |
Reverting this would break voila: https://github.com/QuantStack/voila/blob/807f635d56fc741d1029dbe31b1a51841a8fb996/voila/html.py#L22 Looking at
It seems the order does matter. I don't think |
Seems like there's a bit more discussion that should take place, going to drop this and focus on another error for PyCon :) |
Thanks for chiming in, @maartenbreddels. As I told @erinspace when we started looking into it, this is a tricky issue because no matter what we do, we will break someone code. The question is, which code should we break - those who have been extending Is there another way to get around the unfortunate parameter ordering that contextfilter imposes, so we could achieve the |
Given that it is not documented, e.g. not part of the generated documentation, I assumed it was not a public API, which does not mean people use it, and it has become it.
A good lesson for API design, this choice of adding parameters is very unfortunate. why not do *args, test for the length and based on that make the right decision, it's ugly, but it doesn't break anything, and gives no hints about the argument. |
Hmmm yeah I think you're right that this is the contract for jinja and it's a jinja / internal function call. I believe *args might cause problems for jinja? I'll open an issue on fastai for them to change the pattern there. |
Looking at the jinja code it will work, but I'm not sure we want to depend on that. We could have a method Note that subclasses are free to override markdown2html and drop the decorator. |
fastai resolved this with a version check fastai/fastai@21faa5d that forks the method invocation to match |
Compatibility with fast.ai's librarys doc() method is broken. Using it now creates an error due to the latest update in markdown2html.
Commit 654d6a3 changes the method signature:
fast.ai's librarys doc() method calls
output = HTMLExporter().markdown2html(md)
Is it possible to make the change backwards compatible instead of introducing a mandatory extra argument in front of the old one?
The text was updated successfully, but these errors were encountered: