Skip to content

Commit

Permalink
feat: added em tag support
Browse files Browse the repository at this point in the history
  • Loading branch information
privateOmega committed Jun 8, 2020
1 parent 6d64908 commit 6a06265
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/helpers/xml-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ const buildTextFormatting = (vNode) => {
case 'strong':
const boldFragment = buildBold();
return boldFragment;
case 'em':
case 'i':
const italicsFragment = buildItalics();
return italicsFragment;
Expand Down Expand Up @@ -326,7 +327,7 @@ const buildRun = (vNode, attributes) => {
if (isVNode(vNode)) {
while (
isVNode(vNode) &&
['strong', 'i', 'u', 'ins', 'strike', 'del', 's', 'sub', 'sup'].includes(vNode.tagName)
['strong', 'em', 'i', 'u', 'ins', 'strike', 'del', 's', 'sub', 'sup'].includes(vNode.tagName)
) {
const formattingFragment = buildTextFormatting(vNode);
runPropertiesFragment.import(formattingFragment);
Expand All @@ -339,7 +340,7 @@ const buildRun = (vNode, attributes) => {
const childVNode = vNode.children[index];
if (
isVNode(childVNode) &&
['strong', 'i', 'u', 'ins', 'strike', 'del', 's', 'sub', 'sup'].includes(
['strong', 'em', 'i', 'u', 'ins', 'strike', 'del', 's', 'sub', 'sup'].includes(
childVNode.tagName
)
) {
Expand Down

0 comments on commit 6a06265

Please sign in to comment.