Skip to content

Commit

Permalink
Merge pull request #9 from picandocodigo/master
Browse files Browse the repository at this point in the history
Emoji Filter is back
  • Loading branch information
adamlogic committed Dec 18, 2012
2 parents 8231aac + 9facba0 commit 5369b23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This is especially notable with fenced code blocks and syntax highlighting.

`ghpreview` is an accurate preview because it uses Github's own [HTML
processing filters](https://github.com/jch/html-pipeline) to generate the HTML,
and Github's own stylesheets to style it.
and Github's own stylesheets to style it :octocat:

## Contributing

Expand Down
8 changes: 7 additions & 1 deletion lib/ghpreview/previewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ def open
def markdown_to_html
markdown = File.read(@md_filepath)

context = {
asset_root: "http://assets.github.com/images/icons/",
gfm: false
}

pipeline = HTML::Pipeline.new([
HTML::Pipeline::MarkdownFilter,
HTML::Pipeline::SanitizationFilter,
HTML::Pipeline::ImageMaxWidthFilter,
HTML::Pipeline::HttpsFilter,
HTML::Pipeline::MentionFilter,
HTML::Pipeline::EmojiFilter,
HTML::Pipeline::SyntaxHighlightFilter
], gfm: false)
], context)
result = pipeline.call(markdown)[:output].to_s
end

Expand Down

0 comments on commit 5369b23

Please sign in to comment.