Forum > Suggestions >
Better way of measuring signature lines (3 line limit)
Posted
So i got bored today and i wanted to check if i could find a way to measure the signature's lines while bypassing the method used to bypass the current method
So i came up with this:
// code beginning
let e = document.querySelector(".mce-content-body") // the signature in the manager
if(e.innerText.split("\n").length > 5) {
console.log("Siggy too long, sorry")
} else {
console.log("Siggy is okay in length")
}
// code ending
The reason why it's 5 and not 3 is that when you do .innerText on an html tag that has other html tags in it, there are extra lines. I didn't experience anything buggy with it, so i guess it works well.
My new discord is Wabz#1337 with ID 777154062789509130
Replied
uhhhh
quite useless but cool
Cancel
Post
Replied
@_realnickk jsdom (a nodejs package) has a pretty great virtual DOM he could use that
Cancel
Post
My new discord is Wabz#1337 with ID 777154062789509130
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post