Skip to content

gfm: add tagfilter option#64

Merged
icyleaf merged 1 commit into
icyleaf:masterfrom
nobodywasishere:nobody/gfm-tagfilter
May 31, 2024
Merged

gfm: add tagfilter option#64
icyleaf merged 1 commit into
icyleaf:masterfrom
nobodywasishere:nobody/gfm-tagfilter

Conversation

@nobodywasishere

Copy link
Copy Markdown
Collaborator

When enabled (alongside the gfm option), it will escape certain HTML tags

require "./src/markd"

markdown = <<-MD
# Hello Markd

> Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.

<title>this isn't allowed</title>

<style>
  title {
    font-size: 100px;
  }
</style>
MD

options = Markd::Options.new(gfm: true, tagfilter: true)
puts Markd.to_html(markdown, options)

Output:

<h1>Hello Markd</h1>
<blockquote>
<p>Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.</p>
</blockquote>
&lt;title>this isn't allowed&lt;/title>
&lt;style>
  title {
    font-size: 100px;
  }
&lt;/style>

When enabled (alongside gfm), it will escape certain HTML tags
@trafico-bot trafico-bot Bot added the 🔍 Ready for Review Pull Request is not reviewed yet label May 31, 2024
@icyleaf
icyleaf merged commit 7fe5ede into icyleaf:master May 31, 2024
@trafico-bot trafico-bot Bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 31, 2024
@nobodywasishere
nobodywasishere deleted the nobody/gfm-tagfilter branch May 31, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Merged Pull Request has been merged successfully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants