Skip to content

Commit

Permalink
Switch default to even 768
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorns committed Nov 21, 2023
1 parent 03bda22 commit 219b9cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions md2cf/confluence_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ def block_code(self, code, lang=None):
root_element.append(self.plain_text_body(code))
return root_element.render()

def image(self, src, title, text, width=764, height=None):
def image(self, src, title, text, width=768, height=None):
"""
Render an image as Confluence Storage Format.
See https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html
:param src: The image source path
:param title: The title of the image
:param text: Used as alt (tooltip) text for the image
:param width: The rendered width of the image, defaults to 764 which seems to work well in Confluence.
:param width: The rendered width of the image, defaults to 768 which seems to work well in Confluence.
:param height: Specify the height of the image, relative to width by default.
"""
attributes = {"alt": text}
Expand Down
8 changes: 4 additions & 4 deletions test_package/unit/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_renderer_header_only_sets_first_title():
def test_renderer_image_external():
test_image_src = "http://example.com/image.jpg"
test_image_markup = (
'<ac:image ac:alt="" ac:width="764"><ri:url ri:value="{}"></ri:url>\n'
'<ac:image ac:alt="" ac:width="768"><ri:url ri:value="{}"></ri:url>\n'
"</ac:image>\n".format(test_image_src)
)

Expand All @@ -220,7 +220,7 @@ def test_renderer_image_external_alt_and_title():
test_image_alt = "alt text"
test_image_title = "title"
test_image_markup = (
'<ac:image ac:alt="{}" ac:title="{}" ac:width="764"><ri:url ri:value="{}"></ri:url>\n'
'<ac:image ac:alt="{}" ac:title="{}" ac:width="768"><ri:url ri:value="{}"></ri:url>\n'
"</ac:image>\n".format(test_image_alt, test_image_title, test_image_src)
)

Expand All @@ -236,7 +236,7 @@ def test_renderer_image_internal_absolute():
test_image_file = "image.jpg"
test_image_src = "/home/test/images/" + test_image_file
test_image_markup = (
'<ac:image ac:alt="" ac:width="764"><ri:attachment ri:filename="{}"></ri:attachment>\n'
'<ac:image ac:alt="" ac:width="768"><ri:attachment ri:filename="{}"></ri:attachment>\n'
"</ac:image>\n".format(test_image_file)
)

Expand All @@ -250,7 +250,7 @@ def test_renderer_image_internal_relative():
test_image_file = "image.jpg"
test_image_src = "test/images/" + test_image_file
test_image_markup = (
'<ac:image ac:alt="" ac:width="764"><ri:attachment ri:filename="{}"></ri:attachment>\n'
'<ac:image ac:alt="" ac:width="768"><ri:attachment ri:filename="{}"></ri:attachment>\n'
"</ac:image>\n".format(test_image_file)
)

Expand Down

0 comments on commit 219b9cc

Please sign in to comment.