(function () { var content = "国庆节快乐。\n\n此刻,从新开始。"; // 只保留a标签 var jsTextContent = document.getElementById("js_text_content"); var jsTextContentFake = document.getElementById("js_text_content_fake"); // console.log(content); content = content.replace(/<(\/?)(?!((a(\s|>))|(\/a))).*?>/g, (s) => { return s.html(true); }); jsTextContent.innerHTML = window.__emojiFormat(content); if (parseFloat(window.getComputedStyle(jsTextContent).height) > parseFloat(window.getComputedStyle(jsTextContentFake).height)) { jsTextContent.parentNode.className += ' share_media_text_overflow'; } })();