summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Milligan <tom.milligan@uipath.com>2024-06-20 10:40:44 +0100
committerGitHub <noreply@github.com>2024-06-20 10:40:44 +0100
commita942a8094e0091c651b3e3b1994f36af3776da29 (patch)
treecd20f734c40d9792a83aa778e163f66c1360b79a
parent41a3b05094c9907a82456bb0de983da006b9ba86 (diff)
parentd10a427b0fc28a664bae01f3ab65246b1b555780 (diff)
Merge pull request #197 from tommilligan/toml-serialize-error
fix: use up to date toml for serialization
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml4
-rw-r--r--src/bin/mdbook-admonish.rs2
-rw-r--r--src/book_config.rs5
4 files changed, 4 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e4da103..fe486d5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -983,7 +983,6 @@ dependencies = [
"semver",
"serde",
"serde_json",
- "toml 0.5.11",
"toml 0.8.13",
"toml_edit",
]
diff --git a/Cargo.toml b/Cargo.toml
index 1c045fd..3f7fb1d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -41,10 +41,6 @@ regex = "1.9.6"
semver = "1.0.19"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
-# Peer dependency of mdbook
-# The version of toml that mdbook uses internally (and uses in it's public api)
-# Only used for compatilibilty with the mdbook public api
-toml_mdbook = { package = "toml", version = "0.5.11" }
toml = "0.8.1"
toml_edit = { version = "0.22.13", optional = true }
hex_color = { version = "3.0.0", features = ["serde"] }
diff --git a/src/bin/mdbook-admonish.rs b/src/bin/mdbook-admonish.rs
index 86c7fae..60c25e0 100644
--- a/src/bin/mdbook-admonish.rs
+++ b/src/bin/mdbook-admonish.rs
@@ -125,7 +125,7 @@ struct Preprocessors {
/// Load the plugin specific config as a toml string, for private deserialization.
fn admonish_config_string(config: &Config) -> Result<String> {
- Ok(toml_mdbook::to_string(
+ Ok(toml::to_string(
&config
.preprocessor
.admonish
diff --git a/src/book_config.rs b/src/book_config.rs
index 39507a3..a66a935 100644
--- a/src/book_config.rs
+++ b/src/book_config.rs
@@ -11,11 +11,12 @@ use crate::types::{AdmonitionDefaults, BuiltinDirective, BuiltinDirectiveConfig}
/// Roundtrips config to string, to avoid linking the plugin's internal version of toml
/// to the one publically exposed by the mdbook library.
pub(crate) fn admonish_config_from_context(ctx: &PreprocessorContext) -> Result<Config> {
- let table: String = toml_mdbook::to_string(
+ let table: String = toml::to_string(
ctx.config
.get_preprocessor("admonish")
.context("No configuration for mdbook-admonish in book.toml")?,
- )?;
+ )
+ .context("Could not serialize mdbook-admonish config. This is a bug in the toml library.")?;
admonish_config_from_str(&table)
}