Skip to content

Commit faeaa40

Browse files
committed
upgrade comrak to 0.43.0
1 parent b3d5520 commit faeaa40

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ docsrs-metadata = { path = "crates/metadata" }
3737
anyhow = { version = "1.0.42", features = ["backtrace"]}
3838
backtrace = "0.3.61"
3939
thiserror = "2.0.3"
40-
comrak = { version = "0.41.0", default-features = false }
40+
comrak = { version = "0.43.0", default-features = false }
4141
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "html", "dump-load", "regex-onig"] }
4242
toml = "0.9.2"
4343
prometheus = { version = "0.14.0", default-features = false }

src/web/markdown.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::web::highlight;
22
use comrak::{
33
ExtensionOptions, Options, Plugins, RenderPlugins, adapters::SyntaxHighlighterAdapter,
44
};
5-
use std::collections::HashMap;
5+
use std::{collections::HashMap, fmt};
66

77
#[derive(Debug)]
88
struct CodeAdapter<F>(F, Option<&'static str>);
@@ -12,10 +12,10 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
1212
{
1313
fn write_highlighted(
1414
&self,
15-
output: &mut dyn std::io::Write,
15+
output: &mut dyn fmt::Write,
1616
lang: Option<&str>,
1717
code: &str,
18-
) -> std::io::Result<()> {
18+
) -> Result<(), fmt::Error> {
1919
// comrak does not treat `,` as an info-string delimiter, so we do that here
2020
// TODO: https://github.com/kivikakk/comrak/issues/246
2121
let lang = lang.and_then(|lang| lang.split(',').next());
@@ -24,17 +24,17 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
2424

2525
fn write_pre_tag(
2626
&self,
27-
output: &mut dyn std::io::Write,
27+
output: &mut dyn fmt::Write,
2828
attributes: HashMap<String, String>,
29-
) -> std::io::Result<()> {
29+
) -> Result<(), fmt::Error> {
3030
write_opening_tag(output, "pre", &attributes)
3131
}
3232

3333
fn write_code_tag(
3434
&self,
35-
output: &mut dyn std::io::Write,
35+
output: &mut dyn fmt::Write,
3636
attributes: HashMap<String, String>,
37-
) -> std::io::Result<()> {
37+
) -> Result<(), fmt::Error> {
3838
// similarly to above, since comrak does not treat `,` as an info-string delimiter it will
3939
// try to apply `class="language-rust,ignore"` for the info-string `rust,ignore`, so we
4040
// have to detect that case and fixup the class here
@@ -54,10 +54,10 @@ impl<F: Fn(Option<&str>, &str, Option<&str>) -> String + Send + Sync> SyntaxHigh
5454
}
5555

5656
fn write_opening_tag(
57-
output: &mut dyn std::io::Write,
57+
output: &mut dyn fmt::Write,
5858
tag: &str,
5959
attributes: &HashMap<String, String>,
60-
) -> std::io::Result<()> {
60+
) -> Result<(), fmt::Error> {
6161
write!(output, "<{tag}")?;
6262
for (attr, val) in attributes {
6363
write!(output, " {attr}=\"{val}\"")?;

0 commit comments

Comments
 (0)