From 502809c5720519dc92edaeb2a888d95bb16b5dfd Mon Sep 17 00:00:00 2001
From: Brian Gonzalez
Date: Sun, 30 Oct 2016 20:57:45 -0700
Subject: [PATCH] WIP: spread
---
src/shave.js | 3 ++-
tests/index.html | 5 +----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/shave.js b/src/shave.js
index 3240f087..7c444112 100644
--- a/src/shave.js
+++ b/src/shave.js
@@ -27,7 +27,8 @@ export default function shave(target, maxHeight, opts) {
if (el.offsetHeight < maxHeight) continue;
const fullText = el.textContent;
- const words = fullText.split(' ');
+ // const words = fullText.split(' ');
+ const words = [...fullText];
// If 0 or 1 words, we're done
if (words.length < 2) continue;
diff --git a/tests/index.html b/tests/index.html
index 90353d5b..e70df5c5 100644
--- a/tests/index.html
+++ b/tests/index.html
@@ -37,10 +37,7 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin consequat eros, non posuere justo hendrerit quis. Integer eget risus dapibus, rutrum nisl sit amet, posuere dui. Cras vitae urna ac urna placerat vulputate. Morbi et tortor vel nisi rutrum consequat. Pellentesque non sem cursus, rhoncus nisi sed, semper quam. Phasellus efficitur iaculis auctor. Pellentesque at aliquam leo. Proin diam nulla, mollis vitae nibh sit amet, interdum suscipit risus. Sed fermentum leo enim, a pretium ipsum sollicitudin non. Nunc tempus nunc sed laoreet porttitor. Duis varius purus pellentesque luctus vestibulum. In ex dui, maximus vitae nisl a, molestie malesuada purus. Duis semper est in varius mattis. Pellentesque mollis convallis ex eu pretium.
Vivamus eleifend nunc a sem euismod, non consequat purus varius. Donec hendrerit eleifend ex ac cursus. Ut ac nibh quis massa rhoncus accumsan. Praesent ultricies arcu quis magna tempus, vitae tristique diam euismod. Proin accumsan quam magna, quis condimentum diam lacinia et. Quisque tempor tellus neque, vitae facilisis dui mollis sit amet. Sed sit amet augue ac mi cursus egestas nec gravida velit. Suspendisse eu nunc tristique lorem eleifend vulputate. Aliquam viverra ex sed augue mollis, eu feugiat purus volutpat. Donec consectetur a lectus ac accumsan. Aenean massa libero, pellentesque a ultrices nec, commodo eget neque. Duis blandit augue et tempus egestas. Aenean facilisis lectus eget venenatis blandit. Nam porta sollicitudin erat, at fermentum eros iaculis ut.
-
-
- 會全用民知多起功在有場館爾期臺多而不雄山選在場地市者電養說化運面遊聲時上教要下素的正一曾又如到性喜色體歷定部手里克業選陽響水起金園際吃權終麼意建本分香來象洋道方業動害有不財是了題此然把經會得善所建那各相標一來依正員由不古達解工面想推的。
-
+ 會全用民知多起功在有場館爾期臺多而不雄山選在場地市者電養說化運面遊聲時上教要下素的正一曾又如到性喜色體歷定部手里克業選陽響水起金園際吃權終麼意建本分香來象洋道方業動害有不財是了題此然把經會得善所建那各相標一來依正員由不古達解工面想推的。
那各相標一來依正員由不古達解工面想推的。