Change not to delete the element specified in invisible

This commit is contained in:
noellabo 2020-02-24 23:56:04 +09:00
parent 0345323100
commit 9faf45d0fd
2 changed files with 0 additions and 2 deletions

View file

@ -92,7 +92,6 @@ export function normalizeStatus(status, normalOldStatus) {
normalStatus.quote.account.display_name_html = emojify(escapeTextContentForBrowser(displayName), quote_account_emojiMap);
normalStatus.quote.search_index = domParser.parseFromString(quote_searchContent, 'text/html').documentElement.textContent;
let docElem = domParser.parseFromString(normalStatus.quote.content, 'text/html').documentElement;
Array.from(docElem.querySelectorAll('span.invisible'), span => span.remove());
Array.from(docElem.querySelectorAll('p,br'), line => {
let parentNode = line.parentNode;
if (line.nextSibling) {

View file

@ -48,7 +48,6 @@ class Formatter
html = format(status)
return '' if html.empty?
doc = Nokogiri::HTML.parse(html, nil, 'utf-8')
doc.search('span.invisible').remove
html = doc.css('body')[0].inner_html
html.sub!(/^<p>(.+)<\/p>$/, '\1')
html = Sanitize.clean(html).delete("\n").truncate(150)