Skip to content

Commit f52718e

Browse files
committed
[src/md_proccessor, README] Added keyword for to allow autoscaling of image along one dimension as mentioned in [Issue #14](#14). Updated README to include documentation for feature.
1 parent ce5ebef commit f52718e

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ e.g.
3030

3131

3232
**Resizing**
33-
When resizing internally embedded images one can normally use the `<width>x<height>` after the pipe (`|`) character.
33+
When resizing internally embedded images one can normally use the `<width>x<height>` after the pipe (`|`) character. Use the keyword `auto` as `<width>` or `height` to set the size of one dimension and auto-scale the other.
3434

3535
e.g.
3636

3737
```markdown
3838
![[my_amazing_image.png|50x50]]
39+
![[my_long_photo|autox200]]
3940
```
4041

4142
You can now resize both internally and externally embeded images with caption. However, delimeters must be used to distinguis the caption text if it is present.
@@ -71,7 +72,7 @@ A delimeter is a set of characters that identify the caption text to use. The de
7172
+ **Note:** Only the first and last delimeters are matched, so the delimeter character can be used in the caption without special consideration, such as escaping.
7273

7374
+ **Caption as HTML:** Allows your captions to be rendered as HTML.<br/>
74-
By turning this option on your captions will be inserted into the document as HTML, rather than text.
75+
By turning this option on your captions will be inserted into the document as HTML rather than text.
7576

7677
## FAQ
7778

manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"id": "obsidian-image-caption",
33
"name": "Image Caption",
4-
"version": "0.0.12",
5-
"minAppVersion": "0.13.23",
4+
"version": "0.0.13",
5+
"minAppVersion": "0.14.2",
66
"description": "Add captions to images.",
77
"author": "Brian Carlsen",
88
"authorUrl": "https://github.com/bicarlsen",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-image-caption",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"description": "Add captions to images in Obsidian.",
55
"main": "main.js",
66
"scripts": {

src/md_processor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function parseSize( text: string ) {
190190
return undefined;
191191
}
192192

193-
const size_pattern = /(\d+)x(\d+)/i;
193+
const size_pattern = /(\d+|auto)x(\d+|auto)/i;
194194
const match = text.match( size_pattern );
195195
if ( ! match ) {
196196
return undefined;

versions.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"0.0.13": "0.14.2",
23
"0.0.12": "0.13.23",
34
"0.0.11": "0.13.19",
45
"0.0.10": "0.13.19",

0 commit comments

Comments
 (0)