Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions fuzz/fuzz_targets/all_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ impl FuzzExtensionOptions {
} else {
None
},
#[allow(deprecated)]
header_ids: None,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ fn render_heading<T>(
context.cr()?;
write!(context, "<h{}", nh.level)?;

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.anchorizer.anchorize(&text_content);

Expand All @@ -619,7 +619,7 @@ fn render_heading<T>(
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 {
Expand Down
86 changes: 0 additions & 86 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<nodes::AstNode<'a>>;

#[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.
Expand Down
10 changes: 1 addition & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ struct Cli {
#[arg(long, value_name = "PREFIX", required = false)]
header_id_prefix: Option<String>,

/// Deprecated: use --header-id-prefix instead
#[arg(long, value_name = "PREFIX", required = false, hide = true)]
header_ids: Option<String>,

/// Apply the header ID prefix to the href anchor as well
#[arg(long)]
header_id_prefix_in_href: bool,
Expand Down Expand Up @@ -298,10 +294,6 @@ fn main() -> Result<(), Box<dyn Error>> {
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()
Expand All @@ -311,7 +303,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.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))
Expand Down
14 changes: 0 additions & 14 deletions src/parser/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ pub struct Extension<'c> {
/// ```
pub header_id_prefix: Option<String>,

#[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<String>,

/// 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.
///
Expand Down Expand Up @@ -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<WikiLinksMode> {
match (
self.wikilinks_title_before_pipe,
Expand Down
Loading