Remove some old code from getInnerText
This commit is contained in:
parent
e9116cc36c
commit
e66ff70ac4
|
@ -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 ''
|
||||||
|
|
Loading…
Reference in New Issue