diff --git a/better_figures_and_images/better_figures_and_images.py b/better_figures_and_images/better_figures_and_images.py index 40737f2..fa4498a 100644 --- a/better_figures_and_images/better_figures_and_images.py +++ b/better_figures_and_images/better_figures_and_images.py @@ -6,7 +6,7 @@ This plugin: - Adds a style="width: ???px; height: auto;" to each image in the content - Also adds the width of the contained image to any parent div.figures. - - If RESPONSIVE_IMAGES == True, adds style="max-width: 100%; height: auto;" instead + - If RESPONSIVE_IMAGES == True, adds style="width: ???px; max-width: 100%; height: auto;" instead - Corrects alt text: if alt == image filename, set alt = '' TODO: Need to add a test.py for this plugin. @@ -27,16 +27,6 @@ def content_object_init(instance): content = instance._content soup = BeautifulSoup(content) - # if '` tags in the content, by checking +- Adds a `style="width: ???px; height: auto;"` attribute to any `` tags in the content, by checking the dimensions of the image file and adding the appropriate `style="width: ???px; height: auto;"` to the `` tag. - Also finds any `div class="figures"` tags in the content, that contain images and adds the same style to them too. -- If RESPONSIVE_IMAGES setting is true, it adds `style="max-width: 100%; height: auto;"` instead. +- If RESPONSIVE_IMAGES setting is true, it adds `style="width: ???px; max-width: 100%; height: auto;"` instead. - Corrects Alt text: If an img alt attribute = the image filename, it sets it to "" @@ -38,8 +38,8 @@ into output like this: or this, if RESPONSIVE_IMAGES = True: -
- +
+

This is the caption of the figure.