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:
Ben Gotow 2015-08-25 16:08:16 -07:00
parent 6c407f2f1c
commit 1b67728033

View file

@ -16,9 +16,9 @@ class DraftList extends React.Component
componentWillMount: => componentWillMount: =>
snippet = (html) => snippet = (html) =>
@draftSanitizer ?= document.createElement('div') @draftSanitizer ?= document.createElement('div')
@draftSanitizer.innerHTML = html @draftSanitizer.innerHTML = html[0..400]
text = @draftSanitizer.innerText text = @draftSanitizer.innerText
text[0..140] text[0..200]
c1 = new ListTabular.Column c1 = new ListTabular.Column
name: "Name" name: "Name"