Created
February 13, 2019 08:30
-
-
Save dongsik-yoo/3af7a849da0b83518c2bf003b3c3f52a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// recognize lines | |
let prevSpan; | |
wrappers.forEach(span => { | |
const prevSpanBottom = prevSpan ? prevSpan.getBoundingClientRect().bottom : 0; | |
const spanTop = span.getBoundingClientRect().top; | |
if (prevSpanBottom < spanTop) { | |
lines.push(span); | |
} | |
prevSpan = span; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment