discourse/plugins/checklist/spec/pretty_text_spec.rb
Kris a914d3230b
DEV: remap all core icons for fontawesome 6 upgrade (#28715)
Followup to 7d8974d02f

Co-authored-by: David Taylor <david@taylorhq.com>
2024-09-13 16:50:52 +01:00

20 lines
813 B
Ruby

# frozen_string_literal: true
describe PrettyText do
describe "markdown it" do
it "can properly bake boxes" do
md = <<~MD
[],[ ],[x],[X] are all checkboxes
`[ ]` [x](hello) *[ ]* **[ ]** _[ ]_ __[ ]__ ~~[ ]~~ are not checkboxes
MD
html = <<~HTML
<p><span class="chcklst-box fa fa-square-o fa-fw"></span>,<span class="chcklst-box fa fa-square-o fa-fw"></span>,<span class="chcklst-box checked fa fa-square-check-o fa-fw"></span>,<span class="chcklst-box checked permanent fa fa-square-check fa-fw"></span> are all checkboxes<br>
<code>[ ]</code> <a>x</a> <em>[ ]</em> <strong>[ ]</strong> <em>[ ]</em> <strong>[ ]</strong> <s>[ ]</s> are not checkboxes</p>
HTML
cooked = PrettyText.cook(md)
expect(cooked).to eq(html.strip)
end
end
end