Skip to content
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

Update markdown-it-linkify-images to v2.0.0 #1838

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

jovyntls
Copy link
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Fixes #671

Overview of changes:
Update markdown-it-linkify-images to v2.0.0

Anything you'd like to highlight / discuss:

  • The =WxH and =Wx syntax are now working
  • However, =xH doesn't work because { imgClass: 'img-fluid' } sets the height attribute of the image to auto, which seems to be overriding the user-defined height.

Testing instructions:

These work:
![](https://vuejs.org/images/logo.png =20x20)
![](https://vuejs.org/images/logo.png =20x)
<panel header="**width & height** :rocket: ![](https://vuejs.org/images/logo.png =20x20)"> ...  </panel>
<panel header="**width** ![](https://vuejs.org/images/logo.png =20x)" type="seamless"> ...  </panel>

These don't work (`=xH`):
![](https://vuejs.org/images/logo.png =x20)
<panel header="**height** :rocket: ![](https://vuejs.org/images/logo.png =x20)" type="seamless"> ...  </panel>

Proposed commit message: (wrap lines at 72 characters)

Update markdown-it-linkify-images to v2.0.0

markdown-it-linkify-images at v1.1.1 overrides image width and height
attributes.

Let's upgrade to v2.0.0 which fixes this problem.

Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jovyntls for the fix.

Seems like =WxH does not set the height as well and img-fluid is needed to ensure that the images are responsive. Another issue is if the specified width is larger than the parent container's width, then img-fluid will also limit the width as well. With that I think this should be the behaviour to ensure that the images do not overflow.

Perhaps the documentation can be updated to inform the users of the limitations mentioned above?

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jovyntls!

LGTM 👍

@jonahtanjz jonahtanjz added this to the 4.0 milestone Mar 18, 2022
@jonahtanjz jonahtanjz merged commit 66f5b19 into MarkBind:master Mar 18, 2022
ryoarmanda pushed a commit to ryoarmanda/markbind that referenced this pull request Apr 4, 2022
markdown-it-linkify-images at v1.1.1 overrides image width and height
attributes.

Let's upgrade to v2.0.0 which fixes this problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

=WxH syntax for specifying image size is not working in some places
2 participants