Skip to content

Commit

Permalink
special case bold with only a single child
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Aug 12, 2023
1 parent 92bdec8 commit a5c9d0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/fix-google-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ export function fixNestedLists (node) {
});
}

// this seems to only occur when running via node: there's a top-level <b> tag
// this seems to only occur when running via nodejs (not the browser): there's a top-level <b> tag
// this is only called once with the parent node
function removeRootBoldWrapper(node) {
// there are some cases, like translating <b>something something</b> where we don't want to remove the root node
if(node.children.length === 1 && node.children[0].tagName === 'b') {
return
}

for(let i = 0; i < node.children.length; i++) {
const child = node.children[i];

Expand Down

0 comments on commit a5c9d0a

Please sign in to comment.