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

Fix image linkify and alt attribute #2046

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/userGuide/syntax/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
![alt text here](https://markbind.org/images/logo-lightbackground.png "title here")
</div>

**Adjusting image dimension**

MarkBind also supports the `=Wx` shorthand for specifying image width:

<include src="codeAndOutput.md" boilerplate >
Expand All @@ -38,3 +40,24 @@ This image has a width of 100px: ![](https://markbind.org/images/logo-lightbackg
</box>

MarkBind does not support setting the height of images through the `=WxH` or `=xH` syntax. This is because images are automatically resized to ensure responsiveness based on their width.

**Auto-linkify**

MarkBind automatically wraps images with link to the image URL such that one can click on the image to view the full image.

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
Click on the image to open the image: ![logo](https://markbind.org/images/logo-lightbackground.png =150x)
</variable>
</include>

If the image is wrapped with a link, the link will be used instead.

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
Clicking on this image will bring you to the MarkBind homepage (instead of opening the image):
[![logo](https://markbind.org/images/logo-lightbackground.png =150x)](https://markbind.org)
</variable>
</include>
111 changes: 94 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/cli/test/functional/test_site/expected/siteData.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@
"additional-delimiters-can-be-used-if-mathdelimiters-plugin-is-enabled": "Additional delimiters can be used if mathDelimiters plugin is enabled"
},
"headingKeywords": {}
},
{
"src": "testImages.md",
"title": "Rendering of images according to specified dimension and auto-linkify ability",
"headings": {
"images": "Images",
"alt": "Alt",
"dimension": "Dimension",
"linkify": "Linkify"
},
"headingKeywords": {}
}
]
}
Loading