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
Fixing issue preventing the correct read of images by full_html and reveal exporters. #3550
Conversation
…eveal exporters. Currently to see and images in the notebook inside a md cell you can use the prefix files/ to read the content of the directory where the ipynb lives. But, if you do a conversion using full_html or reveal exporters, the are not rendered ok because the previous version of this function erased `/files/` instead of `files/`. With this fix, the html files produced by full_html and reveal exporters can read the images in a correct way.
actually, it would even be better if it removed only the first occurences in each url... it might be a little complicated though. |
The logical fix you have made is right, but now the filter can be much too aggressive. This replacement should only ever apply inside urls, and only if the URL starts with |
Try this replacement: for attr in ('src', 'href'):
for q in ('"', "'"):
prefix = "{attr}={q}".format(attr=attr, q=q)
text = text.replace(prefix + "files/", prefix)
return text And change the description to say that it only replaces URLs that start with I'm sure this can be done with a single |
Actually, the regular expression is easy, if you want to just cherry-pick / merge a38edc4 into this PR. |
I have problems cherry-picking / merging this one... maybe because I don't know enough from git... My problem is fetching your code... I think is derived from my PR, but I could not find it any logical way to fetch it... any suggestion? |
To add my changes to your repo:
To add the changeset to your branch:
|
Thanks, I tried exactly what you explained... It has to be some typo... I will do it again and let you know |
OK, done with the cherry-picking... cheking the history of my commands, it was a typo... grrr... Anyways... it is working right here. I hope this could be merged soon. |
Yup, 👍 for me, but I probably shouldn't be the last word, since I wrote the regex. @Carreau? |
looks ok to me. |
Fixing issue preventing the correct read of images by full_html and reveal exporters. only strip `file/` at begining of URL.
Thanks! |
Fixing issue preventing the correct read of images by full_html and reveal exporters. only strip `file/` at begining of URL.
Currently to see and images in the notebook inside a md cell you can use the prefix files/ to read the content of the directory where the ipynb lives. But, if you do a conversion using full_html or reveal exporters, the are not rendered ok because the previous version of this function erased
/files/
instead offiles/
. With this fix, the html files produced by full_html and reveal exporters can read the images in a correct way.