mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
PERF: remove oga gem
oga gem is automatically required by the aws gem the oga gem retains about 1mb of memory, aws now uses nokogiri This also removes the html normalize from the pretty text specs that was a fair bit buggy as the polls test shows.
This commit is contained in:
parent
28365f8ae5
commit
94b2c70c0d
6 changed files with 14 additions and 255 deletions
|
@ -1,10 +1,9 @@
|
|||
require 'rails_helper'
|
||||
require 'html_normalize'
|
||||
|
||||
describe PrettyText do
|
||||
|
||||
def n(html)
|
||||
HtmlNormalize.normalize(html)
|
||||
html.strip
|
||||
end
|
||||
|
||||
it 'supports multi choice polls' do
|
||||
|
@ -95,14 +94,13 @@ describe PrettyText do
|
|||
cooked = PrettyText.cook md
|
||||
|
||||
expected = <<~MD
|
||||
<div class="poll" data-poll-status="open" data-poll-name="poll" data-poll-type="multiple">
|
||||
<div class="poll" data-poll-status="open" data-poll-type="multiple" data-poll-name="poll">
|
||||
<div>
|
||||
<div class="poll-container">
|
||||
<ol>
|
||||
<li data-poll-option-id='b6475cbf6acb8676b20c60582cfc487a'>test 1 <img alt=':slight_smile:' class='emoji' src='/images/emoji/twitter/slight_smile.png?v=5' title=':slight_smile:'> <b>test</b>
|
||||
</li>
|
||||
<li data-poll-option-id='7158af352698eb1443d709818df097d4'>test 2</li>
|
||||
<li data-poll-option-id="b6475cbf6acb8676b20c60582cfc487a">test 1 <img src="/images/emoji/twitter/slight_smile.png?v=5" title=":slight_smile:" class="emoji" alt=":slight_smile:"> <b>test</b>
|
||||
</li>
|
||||
<li data-poll-option-id="7158af352698eb1443d709818df097d4">test 2</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="poll-info">
|
||||
|
@ -110,12 +108,9 @@ describe PrettyText do
|
|||
<span class="info-number">0</span>
|
||||
<span class="info-text">voters</span>
|
||||
</p>
|
||||
<p>
|
||||
Choose up to <strong>2</strong> options</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="poll-buttons">
|
||||
<a title="Cast your votes">Vote now!</a>
|
||||
<a title="Display the poll results">Show results</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue