Skip to content

Commit 26d83bf

Browse files
Copilotreakaleek
andcommitted
Update tests and documentation for flexible image sizing syntax
Co-authored-by: reakaleek <[email protected]>
1 parent 3146e9c commit 26d83bf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/syntax/images.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ If `H` is omitted `W` is used as the height as well.
9696
![alt](img.png "=50%")
9797
```
9898

99+
The sizing syntax is flexible and works with or without spaces before the `=` sign. You can also combine it with a title:
100+
101+
```markdown
102+
![alt](img.png "My Title =50%")
103+
![alt](img.png "My Title=50%")
104+
```
105+
99106

100107

101108
### SVG

tests/Elastic.Markdown.Tests/Inline/InlineImageTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public void GeneratesAttributesInHtml() =>
7676
);
7777
}
7878

79-
// Test image sizing with space after =
80-
public class InlineImageWithSizingSpaceAfterTest(ITestOutputHelper output) : InlineTest<LinkInline>(output,
79+
// Test image sizing with title but no space before =
80+
public class InlineImageWithTitleNoSpaceBeforeTest(ITestOutputHelper output) : InlineTest<LinkInline>(output,
8181
"""
82-
![Elasticsearch](/_static/img/observability.png "=50% ")
82+
![Elasticsearch](/_static/img/observability.png "My Title=50%")
8383
"""
8484
)
8585
{
@@ -90,7 +90,7 @@ public class InlineImageWithSizingSpaceAfterTest(ITestOutputHelper output) : Inl
9090
public void GeneratesAttributesInHtml() =>
9191
// language=html
9292
Html.ShouldContainHtml(
93-
"""<p><img src="/docs/_static/img/observability.png" alt="Elasticsearch" width="50%" height="50%" /></p>"""
93+
"""<p><img src="/docs/_static/img/observability.png" alt="Elasticsearch" title="My Title" width="50%" height="50%" /></p>"""
9494
);
9595
}
9696

0 commit comments

Comments
 (0)