Skip to content

Commit

Permalink
Backport Upskirt changes (Fix HTML filter flag)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed May 1, 2011
1 parent 70f0370 commit 287a8b7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions ext/xhtml.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,7 @@ rndr_raw_html(struct buf *ob, struct buf *text, void *opaque)
struct xhtml_renderopt *options = opaque;
int escape_html = 0;

if (options->flags & XHTML_SKIP_HTML)
escape_html = 1;

else if ((options->flags & XHTML_SKIP_STYLE) != 0 && is_html_tag(text, "style"))
if ((options->flags & XHTML_SKIP_STYLE) != 0 && is_html_tag(text, "style"))
escape_html = 1;

else if ((options->flags & XHTML_SKIP_LINKS) != 0 && is_html_tag(text, "a"))
Expand Down Expand Up @@ -788,6 +785,11 @@ ups_xhtml_renderer(struct mkd_renderer *renderer, unsigned int render_flags)
renderer->autolink = NULL;
}

if (render_flags & XHTML_SKIP_HTML) {
renderer->raw_html_tag = NULL;
renderer->blockhtml = NULL;
}

if (render_flags & XHTML_SMARTYPANTS)
renderer->normal_text = rndr_smartypants;

Expand Down
2 changes: 1 addition & 1 deletion lib/redcarpet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# end
#
class Redcarpet
VERSION = '1.12.0'
VERSION = '1.12.1'

# Original Markdown formatted text.
attr_reader :text
Expand Down
4 changes: 2 additions & 2 deletions redcarpet.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Gem::Specification.new do |s|
s.name = 'redcarpet'
s.version = '1.12.0'
s.version = '1.12.1'
s.summary = "Ruby bindings for libupskirt"
s.description = 'A fast and safe Markdown to (X)HTML parser'
s.date = '2011-04-30'
s.date = '2011-05-01'
s.email = 'vicent@github.com'
s.homepage = 'http://github.com/tanoku/redcarpet'
s.has_rdoc = true
Expand Down
2 changes: 1 addition & 1 deletion upskirt
Submodule upskirt updated from bb9dbe to c7c76b

0 comments on commit 287a8b7

Please sign in to comment.