mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 07:46:06 +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
bb887a4ae8
commit
633079bf3f
|
@ -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