mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 04:28:29 -05:00
* FEATURE: Bundle discourse-spoiler-alert plugin into core
Formerly https://github.com/discourse/discourse-spoiler-alert
* DEV: Switch to new addComposerToolbarPopupMenuOption plugin API
`api.addToolbarPopupMenuOptionsCallback` has been deprecated in 913fd3a7b3
This commit was just added to the plugin, so adding it here.
https://github.com/discourse/discourse-spoiler-alert/commit/49f86ba72ecba6875ae17b3cf7342c3cf79107c9
16 lines
514 B
Ruby
16 lines
514 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
describe PrettyText do
|
|
it "should remove spoilers from excerpts" do
|
|
expect(
|
|
PrettyText.excerpt("<div class='spoiler'><img src='http://cnn.com/a.gif'></div>", 100),
|
|
).to match_html ""
|
|
expect(PrettyText.excerpt("<span class='spoiler'>spoiler</span>", 100)).to match_html ""
|
|
expect(
|
|
PrettyText.excerpt("Inline text <span class='spoiler'>spoiler</span> after spoiler", 100),
|
|
).to match_html "Inline text after spoiler"
|
|
end
|
|
end
|