Skip to content

Commit d912ca6

Browse files
prepare release 0.9.0 with svgdx 0.22.1
1 parent 75516e0 commit d912ca6

File tree

4 files changed

+47
-43
lines changed

4 files changed

+47
-43
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.9.0 2025-08-10]
11+
12+
- Changed: updated to svgdx 0.22.1
13+
1014
## [0.8.1 2025-07-17]
1115

1216
- Fixed: handle fenced code block split across Text events (#1)

Cargo.lock

Lines changed: 33 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mdbook-svgdx"
3-
version = "0.8.1"
3+
version = "0.9.0"
44
description = "mdbook preprocessor to convert svgdx fenced code blocks into inline SVG images"
55
authors = ["Ben Bass <benbass@codedstructure.net>"]
66
repository = "https://github.com/codedstructure/mdbook-svgdx"
@@ -16,7 +16,7 @@ pulldown-cmark = "0.10"
1616
pulldown-cmark-to-cmark = "14.0"
1717
semver = "1.0"
1818
serde_json = "1.0"
19-
svgdx = { version = "0.21.0", default-features = false }
19+
svgdx = { version = "0.22.1", default-features = false }
2020

2121
[dev-dependencies]
2222
assertables = "9.5.0"

src/lib.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use pulldown_cmark::{
3333
Tag, TagEnd,
3434
};
3535
use pulldown_cmark_to_cmark::cmark;
36+
use svgdx::AutoStyleMode;
3637

3738
pub struct SvgdxProc;
3839

@@ -153,7 +154,7 @@ fn inject_svgdx(events: &mut Vec<Event>, content: &str) {
153154
fn svgdx_handler(s: &str) -> String {
154155
let cfg = svgdx::TransformConfig {
155156
svg_style: Some("min-width: 25%; max-width: 100%; height: auto;".to_string()),
156-
use_local_styles: true,
157+
auto_style_mode: AutoStyleMode::Inline,
157158
scale: 1.5,
158159
..Default::default()
159160
};
@@ -190,9 +191,7 @@ Some **markdown** text
190191
191192
192193
<svg "##;
193-
let expected3 = r##"
194-
<rect width="20" height="5"/>
195-
</svg></div>"##;
194+
let expected3 = r##"<rect width="20" height="5""##;
196195
let mut chapter = Chapter::new("test", content.to_owned(), ".", Vec::new());
197196
let result = codeblock_parser(&mut chapter).unwrap();
198197
assert_contains!(result, expected1);
@@ -207,14 +206,16 @@ Some **markdown** text
207206
fn process_with_crlf() {
208207
// crlf-separated text seems to be parsed into multiple Text events;
209208
// check the fenced code block is still processed as a single unit.
210-
let content = ["Some **markdown** text",
209+
let content = [
210+
"Some **markdown** text",
211211
"",
212212
"```svgdx",
213213
"<svg>",
214214
r#" <rect wh="20 5"/>"#,
215215
r#" <rect xy="^|h" wh="20 5"/>"#,
216216
"</svg>",
217-
"```"]
217+
"```",
218+
]
218219
.join("\r\n");
219220

220221
let expected1 = r##"Some **markdown** text
@@ -224,9 +225,7 @@ Some **markdown** text
224225
225226
226227
<svg "##;
227-
let expected3 = r##"
228-
<rect x="20" y="0" width="20" height="5"/>
229-
</svg></div>"##;
228+
let expected3 = r##"<rect x="20" y="0" width="20" height="5""##;
230229
let mut chapter = Chapter::new("test", content.to_owned(), ".", Vec::new());
231230
let result = codeblock_parser(&mut chapter).unwrap();
232231
assert_contains!(result, expected1);

0 commit comments

Comments
 (0)