-
Notifications
You must be signed in to change notification settings - Fork 6
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
Change return format of images with properties #36
Change return format of images with properties #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good and well prepared! Thank you! I have only two additional suggestions.
- Please update images section in the
README.md
to reflect changes. Commit these changes with the following commit messagedocs(readme): use YouTrack format to render image with attributes
. - Change commit message for the code changes to
feat(images): use YouTrack format to render image with attributes
to follow https://www.conventionalcommits.org/en/v1.0.0/
@@ -23,7 +23,7 @@ jobs: | |||
|
|||
- name: Restore virtualenv from cache | |||
id: cache | |||
uses: actions/cache@v1 | |||
uses: actions/cache@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also bump other actions version?
- actions/checkout@v2 -> actions/checkout@v4
- actions/setup-python@v2 -> actions/setup-python@v5
Could you please move these changes to a separate commit with the following comment: chore(ci): bump actions version
@@ -32,7 +32,7 @@ def action(self, tokens: ParseResults) -> str: | |||
if name in self.ALLOWED_ATTRS | |||
) | |||
if attrs_str: | |||
return f'<img src="{tokens.url}" {attrs_str} />' | |||
return f"![{tokens.url}]({tokens.url})" + "{" + attrs_str + "}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attrs_str
should not contain a value in quotes. I just tested image attributes in the YouTrack. The following image has been render with the correct image size:
![Markdown logo](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png "Markdown"){width=100}
But if attribute value surrounded with the quotes, image size doesn't change
![Markdown logo](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/208px-Markdown-mark.svg.png "Markdown"){width="100"}
You can change this behavior by replacing f'{name}="{value}"'
a few lines above with the f"{name}={value}"
. Related tests should be updated as well.
…h_properties' into feature/change_image_convert_with_properties # Conflicts: # tests/markup/test_images.py # tests/markup/test_mixed_content.py
All changes applied at #37 |
JetBrains change format for images with proprieties at YouTrack, so we need to add some changes at jira2markdown