Extract text inside a text:a tag
This commit is contained in:
parent
0938a97a83
commit
38260814cb
@ -18,7 +18,6 @@ const TEXT_NODE = 3
|
|||||||
function extraxtODSCellText(cell) {
|
function extraxtODSCellText(cell) {
|
||||||
let text = '';
|
let text = '';
|
||||||
const childNodes = cell.childNodes;
|
const childNodes = cell.childNodes;
|
||||||
|
|
||||||
for (const child of Array.from(childNodes)) {
|
for (const child of Array.from(childNodes)) {
|
||||||
if (child.nodeType === TEXT_NODE) {
|
if (child.nodeType === TEXT_NODE) {
|
||||||
// Direct text node, append the text directly
|
// Direct text node, append the text directly
|
||||||
@ -34,6 +33,8 @@ function extraxtODSCellText(cell) {
|
|||||||
text += pChild.nodeValue; // Append text inside <text:p>
|
text += pChild.nodeValue; // Append text inside <text:p>
|
||||||
} else if (pChild.nodeName === 'text:line-break') {
|
} else if (pChild.nodeName === 'text:line-break') {
|
||||||
text += '\n'; // Append newline for <text:line-break />
|
text += '\n'; // Append newline for <text:line-break />
|
||||||
|
} else if (pChild.nodeName === 'text:a') {
|
||||||
|
text += pChild.nodeName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (child.nodeName === 'text:line-break') {
|
} else if (child.nodeName === 'text:line-break') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user