aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-03-28 18:06:33 -0400
committerXe Iaso <me@xeiaso.net>2023-03-28 18:06:37 -0400
commit3b940171e3c6c38352e357c8dab8cdf305c4fdc0 (patch)
tree63f7058b650f683adfe9ad704af638ee2a61dbd0
parent06803ef3c5c88367f4efdba444cef0cd39841b92 (diff)
downloadxesite-3b940171e3c6c38352e357c8dab8cdf305c4fdc0.tar.xz
xesite-3b940171e3c6c38352e357c8dab8cdf305c4fdc0.zip
bump comrak from 0.16.0 to 0.17.0
Replaces #630 Fixes GHSA-8hqf-xjwp-p67v Fixes GHSA-xxmq-4vph-956w Fixes GHSA-5r3x-p7xx-x6q5 Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--Cargo.lock6
-rw-r--r--lib/xesite_markdown/Cargo.toml2
-rw-r--r--lib/xesite_markdown/src/lib.rs6
3 files changed, 6 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b1c20b8..c55a539 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -447,16 +447,14 @@ dependencies = [
[[package]]
name = "comrak"
-version = "0.16.0"
+version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784836d0812dade01579cc0cc9b1684847044e716fd7aa6bffbc172e42199500"
+checksum = "0c5a805f31fb098b1611170028501077ceb8c9e78f5345530f4fdefae9b61119"
dependencies = [
"clap",
"entities",
"memchr",
"once_cell",
- "pest",
- "pest_derive",
"regex",
"shell-words",
"slug",
diff --git a/lib/xesite_markdown/Cargo.toml b/lib/xesite_markdown/Cargo.toml
index 87ba1d7..920d71c 100644
--- a/lib/xesite_markdown/Cargo.toml
+++ b/lib/xesite_markdown/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
color-eyre = "0.6"
-comrak = "0.16.0"
+comrak = "0.17.0"
hex = "0.4"
lazy_static = "1.4"
lol_html = "0.3"
diff --git a/lib/xesite_markdown/src/lib.rs b/lib/xesite_markdown/src/lib.rs
index 008a4ca..11099f6 100644
--- a/lib/xesite_markdown/src/lib.rs
+++ b/lib/xesite_markdown/src/lib.rs
@@ -9,7 +9,7 @@ use lazy_static::lazy_static;
use lol_html::{element, html_content::ContentType, rewrite_str, RewriteStrSettings};
use maud::PreEscaped;
use sha2::{Digest, Sha256};
-use std::{cell::RefCell, io::Write};
+use std::{cell::RefCell, fmt::Write};
use url::Url;
use xesite_types::mastodon::{Toot, User};
@@ -52,7 +52,7 @@ pub fn render(inp: &str) -> Result<String> {
match &mut data.value {
&mut NodeValue::Link(ref mut link) => {
let base = Url::parse("https://xeiaso.net/")?;
- let u = base.join(std::str::from_utf8(&link.url.clone())?)?;
+ let u = base.join(&link.url.clone())?;
if u.scheme() != "conversation" {
return Ok(());
}
@@ -69,7 +69,7 @@ pub fn render(inp: &str) -> Result<String> {
let mood = without_first(u.path());
let name = u.host_str().unwrap_or("Mara");
- let mut html = vec![];
+ let mut html = String::new();
write!(
html,
"{}",