Remove some old code from getInnerText

This commit is contained in:
josdejong 2020-05-06 11:51:15 +02:00
parent e9116cc36c
commit e66ff70ac4
1 changed files with 1 additions and 12 deletions

View File

@ -5,8 +5,7 @@
* @return {String} innerText * @return {String} innerText
*/ */
export function getInnerText (element, buffer) { export function getInnerText (element, buffer) {
const first = (buffer === undefined) if (buffer === undefined) {
if (first) {
buffer = { buffer = {
'text': '', 'text': '',
'flush': function () { 'flush': function () {
@ -54,16 +53,6 @@ export function getInnerText (element, buffer) {
return innerText return innerText
} }
else {
if (element.nodeName === 'P' && getInternetExplorerVersion() !== -1) {
// On Internet Explorer, a <p> with hasChildNodes()==false is
// rendered with a new line. Note that a <p> with
// hasChildNodes()==true is rendered without a new line
// Other browsers always ensure there is a <br> inside the <p>,
// and if not, the <p> does not render a new line
return buffer.flush()
}
}
// br or unknown // br or unknown
return '' return ''