-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not mention or emojify in a codeblock #163
Comments
Could you provide a code snippet to reproduce this? See the contributing guide for details. |
@jch Here's the code snippet: require 'html/pipeline'
#
# Emoji
#
content = <<-MD
:metal:
`:metal:`
MD
puts HTML::Pipeline::EmojiFilter.new(nil, {
asset_root: "https://assets.github.com/images/icons/"
}).emoji_image_filter(content)
#
# Mentions
#
content = <<-MD
@jch
`@jch`
MD
puts HTML::Pipeline::MentionFilter.new(nil, {
base_url: "https://github.com"
}).mention_link_filter(content) |
@parkr the The First, we should convert the Markdown to HTML. Second, we can use the By sending messages to Emoji Example Implementationcontent = <<-MD
:metal:
`:metal:`
MD
puts HTML::Pipeline.new([HTML::Pipeline::MarkdownFilter,HTML::Pipeline::EmojiFilter], {
asset_root: "https://assets.github.com/images/icons/"
}).call(content)[:output].to_s Emoji Example OutputMentions Example Implementationcontent = <<-MD
@jch
`@jch`
MD
puts HTML::Pipeline.new([HTML::Pipeline::MarkdownFilter,HTML::Pipeline::MentionFilter], {
base_url: "https://github.com"
}).call(content)[:output].to_s Mentions Example Output@jch Hope this helps! 😄 |
@parkr any news about this? |
The problem is that the Emoji filter runs before the markdown is rendered. |
@simeonwillbanks We'll have to convert it into a |
OK, cool. I'll close this issue. |
If the
@mention
or:emoji:
is in a code block, do not transform it. This applies to the HTML, rather than to a Markdown, codeblock.Related issues:
Thanks!
The text was updated successfully, but these errors were encountered: