josephschmitt/Clamp.js

Uncaught RangeError: Maximum call stack size exceeded

lper opened this issue · 0 comments

lper commented

function getLastChild(elem) {

        if (elem.lastChild.children && elem.lastChild.children.length > 0) {
            return getLastChild(Array.prototype.slice.call(elem.children).pop());
        } else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue == '' || elem.lastChild.nodeValue == opt.truncationChar) {
            elem.lastChild.parentNode.removeChild(elem.lastChild);
            return getLastChild(element);
        } else {
            return elem.lastChild;
        }
    }