Skip to content

Commit

Permalink
Add [h] tag config
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-wood committed Jan 9, 2023
1 parent 0879e6d commit dbcd37e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/fluxbb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@ def fluxbb_tags
:tag_param_tokens => [{:token => :alt_text, :prefix => ' alt="', :postfix => '"'}],
:tag_param_description => 'The img bbcode takes alt text as a parameter'
),
:h => {
:html_open => "\n### ", :html_close => "\n",
:newlines => :to_br,
:description => 'Make a heading',
:example => '[h]My Heading[/h].'}
}
end

def test_heading
assert_equal "\n### My Heading\n", "[h]My Heading[/h]".bbcode_to_md(false, fluxbb_tags)
end

def test_heading_on_two_lines
assert_equal "\n### My Heading<br>on two lines\n", "[h]My Heading\non two lines[/h]".bbcode_to_md(false, fluxbb_tags)
end

def test_image_with_alt_text
assert_equal '<img src="http://www.ruby-lang.org/images/header-ruby-logo.png" alt="FluxBB allows alt text"/>',
'[img=FluxBB allows alt text]http://www.ruby-lang.org/images/header-ruby-logo.png[/img]'.bbcode_to_md(false, fluxbb_tags)
Expand Down

0 comments on commit dbcd37e

Please sign in to comment.