Skip to content

Commit

Permalink
Merge pull request #1895 from jpeterson976/issue/1654-xml-empty-style…
Browse files Browse the repository at this point in the history
…-tags-prevent-saving

Allow empty XML style tags when saving
  • Loading branch information
zachberry authored Aug 16, 2021
2 parents 610e77b + 372c4ae commit ee3b0b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,17 @@ describe('TextGroup parser', () => {

expect(parsed[0].text.value).toBe('')
})

test('Handles missing text item', () => {
setTextGroupElements([
{
name: 'sup',
value: undefined
}
])

const parsed = textGroupParser(textGroup)

expect(parsed[0].text.value).toBe('')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const parseText = (node, textItem) => {

textItem.styleList.push(styleRange)

if (!node.value) node.value = ''
for (const value of node.value) {
parseText(value, textItem)
}
Expand Down

0 comments on commit ee3b0b6

Please sign in to comment.