Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
ref: accept inline styles in older postings
  • Loading branch information
Christian Kruse committed Mar 13, 2017
1 parent 1454518 commit 137773d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/helpers/parser_helper.rb
Expand Up @@ -69,7 +69,8 @@ def to_doc(app, opts = {})
root_url: opts[:root_url] || app.root_url,
math_engine_opts: { preview: true },
notify_mentions: true,
syntax_highlighter: 'rouge'
syntax_highlighter: 'rouge',
with_styles: (created_at || Time.zone.now) < Time.zone.parse('2017-03-10 15:00')
)

if @doc.blank?
Expand Down
4 changes: 3 additions & 1 deletion lib/cf_kramdown.rb
Expand Up @@ -19,6 +19,7 @@ def initialize(*args)
idx = @block_parsers.index(:setext_header)
@block_parsers[idx] = :cf_setext_header
@app_controller = args.last[:app]
@with_styles = args.last[:with_styles]
end

Kernel.silence_warnings do
Expand Down Expand Up @@ -135,7 +136,8 @@ def update_attr_with_ial(attr, ial)
end

ial.each do |k, v|
next if k =~ /^on.*/ || k == 'style'
next if k =~ /^on.*/
next if k == 'style' && !@with_styles

if k == IAL_CLASS_ATTR
attr[k] = (attr[k] || '') << " #{v}"
Expand Down

0 comments on commit 137773d

Please sign in to comment.