Skip to content

Commit

Permalink
Merge pull request #26 from yuzulabo/colorhex
Browse files Browse the repository at this point in the history
BBCodeでカラーコードに対応
  • Loading branch information
NCLS authored Sep 22, 2017
2 parents f658371 + fe37e74 commit d088717
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/lib/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ def format_bbcode(html)
:quick_param_format => /(2x|3x|4x|5x)/,
:quick_param_format_description => 'The size parameter \'%param%\' is incorrect, a number is expected',
:param_tokens => [{:token => :size}]},
}, :enable, :i, :b, :color, :quote, :code, :size, :u, :s, :spin, :pulse, :flip, :large)
:colorhex => {
:html_open => '<span style="color: #%colorcode%">', :html_close => '</span>',
:description => 'Use color code',
:example => '[colorhex=ffffff]White text[/colorhex]',
:allow_quick_param => true, :allow_between_as_param => false,
:quick_param_format => /([0-9a-fA-F]{6})/,
:quick_param_format_description => 'The size parameter \'%param%\' is incorrect',
:param_tokens => [{:token => :colorcode}]},
}, :enable, :i, :b, :color, :quote, :code, :size, :u, :s, :spin, :pulse, :flip, :large, :colorhex)
rescue Exception => e
end
html
Expand Down

0 comments on commit d088717

Please sign in to comment.