mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 01:54:02 +08:00
9e241e82e9
https://meta.discourse.org/t/markdown-preview-and-result-differ/263878 The result of this markdown had different results in the composer preview and the post. This is solved by updating Loofah to the latest version and using html5 fragments like our user had reported. While the change was only needed in cooked_post_processor.rb for this fix, other areas also had to be updated due to various side effects.
15 lines
360 B
Ruby
15 lines
360 B
Ruby
# frozen_string_literal: true
|
|
include Rails::Dom::Testing::Assertions::DomAssertions
|
|
|
|
RSpec::Matchers.define :be_same_dom do |expected|
|
|
match do |actual|
|
|
begin
|
|
assert_dom_equal(expected, actual)
|
|
rescue MiniTest::Assertion
|
|
false
|
|
end
|
|
end
|
|
|
|
failure_message { |actual| "Expected DOM:\n#{expected}\nto be the same as:\n#{actual}" }
|
|
end
|