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
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/all_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl FuzzExtensionOptions {
) -> options::Extension<'c> {
options::Extension {
strikethrough: self.strikethrough,
#[allow(deprecated)]
tagfilter: self.tagfilter,
table: self.table,
autolink: self.autolink,
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/gfm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libfuzzer_sys::fuzz_target;

use comrak::{markdown_to_html, options, Options};
use comrak::{Options, markdown_to_html, options};

// Note that what I'm targeting here isn't exactly the same
// as --gfm, but rather an approximation of what cmark-gfm
Expand All @@ -11,6 +11,7 @@ use comrak::{markdown_to_html, options, Options};
fuzz_target!(|s: &str| {
let extension = options::Extension {
strikethrough: true,
#[allow(deprecated)]
tagfilter: true,
table: true,
autolink: true,
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/gfm_footnotes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libfuzzer_sys::fuzz_target;

use comrak::{markdown_to_html, options, Options};
use comrak::{Options, markdown_to_html, options};

// Note that what I'm targeting here isn't exactly the same
// as --gfm, but rather an approximation of what cmark-gfm
Expand All @@ -11,6 +11,7 @@ use comrak::{markdown_to_html, options, Options};
fuzz_target!(|s: &str| {
let extension = options::Extension {
strikethrough: true,
#[allow(deprecated)]
tagfilter: true,
table: true,
autolink: true,
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/gfm_sourcepos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libfuzzer_sys::fuzz_target;

use comrak::{markdown_to_html, options, Options};
use comrak::{Options, markdown_to_html, options};

// Note that what I'm targeting here isn't exactly the same
// as --gfm, but rather an approximation of what cmark-gfm
Expand All @@ -11,6 +11,7 @@ use comrak::{markdown_to_html, options, Options};
fuzz_target!(|s: &str| {
let extension = options::Extension {
strikethrough: true,
#[allow(deprecated)]
tagfilter: true,
table: true,
autolink: true,
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/quadratic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(int_roundings)]
#![no_main]
use comrak::{
markdown_to_commonmark, markdown_to_commonmark_xml, markdown_to_html, options, Options,
Options, markdown_to_commonmark, markdown_to_commonmark_xml, markdown_to_html, options,
};
use libfuzzer_sys::arbitrary::{self, Arbitrary};
use libfuzzer_sys::fuzz_target;
Expand Down Expand Up @@ -207,6 +207,7 @@ impl FuzzExtensionOptions {
fn to_options(&self) -> options::Extension<'_> {
options::Extension {
strikethrough: self.strikethrough,
#[allow(deprecated)]
tagfilter: self.tagfilter,
table: self.table,
autolink: self.autolink,
Expand Down
2 changes: 2 additions & 0 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ fn render_html_block<T>(
if entering {
context.cr()?;
let literal = &nhb.literal;
#[allow(deprecated)]
if context.options.render.escape {
context.escape(literal)?;
} else if !context.options.render.r#unsafe {
Expand Down Expand Up @@ -723,6 +724,7 @@ fn render_html_inline<T>(
) -> Result<ChildRendering, fmt::Error> {
// No sourcepos.
if entering {
#[allow(deprecated)]
if context.options.render.escape {
context.escape(literal)?;
} else if !context.options.render.r#unsafe {
Expand Down
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ fn main() -> Result<(), Box<dyn Error>> {
render,
};

if exts.contains(&Extension::Tagfilter) {
eprintln!(
"comrak: tagfilter extension deprecated (poorly designed; will be removed in Comrak 0.56.0)"
);
} else if cli.gfm {
eprintln!(
"comrak: tagfilter extension (implied by --gfm) deprecated (poorly designed; will be removed in Comrak 0.56.0)"
);
}

#[cfg(feature = "syntect")]
let syntax_highlighter: Option<&dyn SyntaxHighlighterAdapter>;
#[cfg(feature = "syntect")]
Expand Down
4 changes: 4 additions & 0 deletions src/parser/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pub struct Extension<'c> {
/// "<p>Hello &lt;xmp>.</p>\n&lt;xmp>\n");
/// ```
#[cfg_attr(feature = "bon", builder(default))]
#[deprecated(
since = "0.55.0",
note = "poorly designed; will be removed in Comrak 0.56.0"
)]
pub tagfilter: bool,

/// Enables the [table extension](https://github.github.com/gfm/#tables-extension-)
Expand Down
Loading