Skip to content

Commit

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

0 comments on commit f867abd

Please sign in to comment.