|
@@ -6,7 +6,7 @@ This plugin:
|
|
|
|
|
|
- Adds a style="width: ???px; height: auto;" to each image in the content
|
|
- 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.
|
|
- 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 = ''
|
|
- Corrects alt text: if alt == image filename, set alt = ''
|
|
|
|
|
|
TODO: Need to add a test.py for this plugin.
|
|
TODO: Need to add a test.py for this plugin.
|
|
@@ -27,16 +27,6 @@ def content_object_init(instance):
|
|
content = instance._content
|
|
content = instance._content
|
|
soup = BeautifulSoup(content)
|
|
soup = BeautifulSoup(content)
|
|
|
|
|
|
- # if '<object type="image/svg+xml"' in content:
|
|
|
|
- # for obj in soup('object'):
|
|
|
|
- # extra_style = 'max-width: 100%;'
|
|
|
|
- # fig = obj.find_parent('div', 'figure')
|
|
|
|
- # if fig:
|
|
|
|
- # if obj.get('style'):
|
|
|
|
- # obj['style'] += extra_style
|
|
|
|
- # else:
|
|
|
|
- # obj['style'] = extra_style
|
|
|
|
-
|
|
|
|
if 'img' in content:
|
|
if 'img' in content:
|
|
for img in soup('img'):
|
|
for img in soup('img'):
|
|
# TODO: Pretty sure this isn't the right way to do this, too hard coded.
|
|
# TODO: Pretty sure this isn't the right way to do this, too hard coded.
|