diff --git a/fuzz/fuzz_targets/all_options.rs b/fuzz/fuzz_targets/all_options.rs index f6b608fa..2fd2ebf0 100644 --- a/fuzz/fuzz_targets/all_options.rs +++ b/fuzz/fuzz_targets/all_options.rs @@ -130,8 +130,6 @@ impl FuzzExtensionOptions { } else { None }, - #[allow(deprecated)] - header_ids: None, } } } diff --git a/src/html.rs b/src/html.rs index 9f22f5fb..1e27e129 100644 --- a/src/html.rs +++ b/src/html.rs @@ -608,7 +608,7 @@ fn render_heading( context.cr()?; write!(context, "( render_sourcepos(context, node)?; context.write_str(">")?; } else { - if let Some(prefix) = context.options.extension.effective_header_id_prefix() { + if let Some(prefix) = &context.options.extension.header_id_prefix { let text_content = node.collect_text(); let id = context.current_anchorized_id.take().unwrap(); let href_prefix = if context.options.extension.header_id_prefix_in_href { diff --git a/src/lib.rs b/src/lib.rs index 3b78d9d0..8081c86f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,92 +100,6 @@ pub use xml::format_document_with_plugins as format_xml_with_plugins; /// Convenience type alias for arena used to hold nodes. pub type Arena<'a> = typed_arena::Arena>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::Extension` instead of `comrak::ExtensionOptions`" -)] -/// Deprecated alias: use [`options::Extension`] instead of [`ExtensionOptions`]. -pub type ExtensionOptions<'c> = parser::options::Extension<'c>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::Parse` instead of `comrak::ParseOptions`" -)] -/// Deprecated alias: use [`options::Parse`] instead of [`ParseOptions`]. -pub type ParseOptions<'c> = parser::options::Parse<'c>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::Render` instead of `comrak::RenderOptions `" -)] -/// Deprecated alias: use [`options::Render`] instead of [`RenderOptions ]`. -pub type RenderOptions = parser::options::Render; - -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::BrokenLinkReference` instead of `comrak::BrokenLinkReference`" -)] -/// Deprecated alias: use [`options::BrokenLinkReference`] instead of [`BrokenLinkReference`]. -pub type BrokenLinkReference<'l> = parser::options::BrokenLinkReference<'l>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::ListStyleType` instead of `comrak::ListStyleType `" -)] -/// Deprecated alias: use [`options::ListStyleType`] instead of [`ListStyleType ]`. -pub type ListStyleType = parser::options::ListStyleType; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::Plugins` instead of `comrak::Plugins`" -)] -/// Deprecated alias: use [`options::Plugins`] instead of [`Plugins`]. -pub type Plugins<'p> = parser::options::Plugins<'p>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::RenderPlugins` instead of `comrak::RenderPlugins`" -)] -/// Deprecated alias: use [`options::RenderPlugins`] instead of [`RenderPlugins`]. -pub type RenderPlugins<'p> = parser::options::RenderPlugins<'p>; -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::WikiLinksMode` instead of `comrak::WikiLinksMode `" -)] -/// Deprecated alias: use [`options::WikiLinksMode`] instead of [`WikiLinksMode ]`. -pub type WikiLinksMode = parser::options::WikiLinksMode; - -#[cfg(feature = "bon")] -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::ExtensionBuilder` instead of `comrak::ExtensionOptionsBuilder`" -)] -/// Deprecated alias: use [`options::ExtensionBuilder`] instead of [`ExtensionOptionsBuilder`]. -pub type ExtensionOptionsBuilder<'c> = parser::options::ExtensionBuilder<'c>; -#[cfg(feature = "bon")] -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::ParseBuilder` instead of `comrak::ParseOptionsBuilder`" -)] -/// Deprecated alias: use [`options::ParseBuilder`] instead of [`ParseOptionsBuilder`]. -pub type ParseOptionsBuilder<'c> = parser::options::ParseBuilder<'c>; -#[cfg(feature = "bon")] -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::RenderBuilder` instead of `comrak::RenderOptionsBuilder `" -)] -/// Deprecated alias: use [`options::RenderBuilder`] instead of [`RenderOptionsBuilder ]`. -pub type RenderOptionsBuilder = parser::options::RenderBuilder; -#[cfg(feature = "bon")] -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::PluginsBuilder` instead of `comrak::PluginsBuilder`" -)] -/// Deprecated alias: use [`options::PluginsBuilder`] instead of [`PluginsBuilder`]. -pub type PluginsBuilder<'p> = parser::options::PluginsBuilder<'p>; -#[cfg(feature = "bon")] -#[deprecated( - since = "0.45.0", - note = "use `comrak::options::RenderPluginsBuilder` instead of `comrak::RenderPluginsBuilder`" -)] -/// Deprecated alias: use [`options::RenderPluginsBuilder`] instead of [`RenderPluginsBuilder`]. -pub type RenderPluginsBuilder<'p> = parser::options::RenderPluginsBuilder<'p>; - /// Render Markdown to HTML. /// /// See the documentation of the crate root for an example. diff --git a/src/main.rs b/src/main.rs index d0870481..120522b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,10 +132,6 @@ struct Cli { #[arg(long, value_name = "PREFIX", required = false)] header_id_prefix: Option, - /// Deprecated: use --header-id-prefix instead - #[arg(long, value_name = "PREFIX", required = false, hide = true)] - header_ids: Option, - /// Apply the header ID prefix to the href anchor as well #[arg(long)] header_id_prefix_in_href: bool, @@ -298,10 +294,6 @@ fn main() -> Result<(), Box> { process::exit(EXIT_CHECK_FILE_NUM); } - if cli.header_ids.is_some() { - eprintln!("warning: --header-ids is deprecated, use --header-id-prefix instead"); - } - let exts = &cli.extensions; let extension = options::Extension::builder() @@ -311,7 +303,7 @@ fn main() -> Result<(), Box> { .autolink(exts.contains(&Extension::Autolink) || cli.gfm) .tasklist(exts.contains(&Extension::Tasklist) || cli.gfm) .superscript(exts.contains(&Extension::Superscript)) - .maybe_header_id_prefix(cli.header_id_prefix.or(cli.header_ids)) + .maybe_header_id_prefix(cli.header_id_prefix) .header_id_prefix_in_href(cli.header_id_prefix_in_href) .footnotes(exts.contains(&Extension::Footnotes)) .inline_footnotes(exts.contains(&Extension::InlineFootnotes)) diff --git a/src/parser/options.rs b/src/parser/options.rs index 06e225ca..7d41afe6 100644 --- a/src/parser/options.rs +++ b/src/parser/options.rs @@ -134,11 +134,6 @@ pub struct Extension<'c> { /// ``` pub header_id_prefix: Option, - #[deprecated(since = "0.52.0", note = "renamed to `header_id_prefix`")] - /// Deprecated: use [`header_id_prefix`](#structfield.header_id_prefix) instead. - #[cfg_attr(feature = "bon", builder(skip))] - pub header_ids: Option, - /// When enabled alongside [`header_id_prefix`](#structfield.header_id_prefix), the header ID /// prefix is also applied to the `href` anchor in the generated link. /// @@ -726,15 +721,6 @@ pub struct Extension<'c> { } impl Extension<'_> { - /// Returns the effective header ID prefix, preferring [`header_id_prefix`] over the - /// deprecated [`header_ids`]. - /// - /// TODO: Remove this method when `header_ids` is removed. - #[allow(deprecated)] - pub(crate) fn effective_header_id_prefix(&self) -> Option<&String> { - self.header_id_prefix.as_ref().or(self.header_ids.as_ref()) - } - pub(crate) fn wikilinks(&self) -> Option { match ( self.wikilinks_title_before_pipe,