mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-09 09:38:07 +08:00
fix(draft-list): Only parse the first 400 characters of HTML to create plaintext snippet
It's possible that 400 characters isn't enough to get any plaintext (if the body begins with a style tag, for example.) Until we get a better solution in place, we need to do this to avoid parsing the king james bible in my draft.
This commit is contained in:
parent
6c407f2f1c
commit
1b67728033
1 changed files with 2 additions and 2 deletions
|
@ -16,9 +16,9 @@ class DraftList extends React.Component
|
|||
componentWillMount: =>
|
||||
snippet = (html) =>
|
||||
@draftSanitizer ?= document.createElement('div')
|
||||
@draftSanitizer.innerHTML = html
|
||||
@draftSanitizer.innerHTML = html[0..400]
|
||||
text = @draftSanitizer.innerText
|
||||
text[0..140]
|
||||
text[0..200]
|
||||
|
||||
c1 = new ListTabular.Column
|
||||
name: "Name"
|
||||
|
|
Loading…
Reference in a new issue