Skip to content

Commit

Permalink
fix: renamed to paragraphStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
robinminso authored and privateOmega committed Mar 20, 2021
1 parent b0e67d8 commit a1c4429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/helpers/render-document-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function findXMLEquivalent(docxDocumentInstance, vNode, xmlFragment) {
lineHeight: Math.max(lineHeight, 240),
strong: 'bold',
beforeSpacing: 240,
heading: `Heading${vNode.tagName[1]}`,
paragraphStyle: `Heading${vNode.tagName[1]}`,
},
docxDocumentInstance
);
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/xml-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,12 @@ const buildIndentation = (left = 720) => {
return indentationFragment;
};

const buildPStyle = (heading = 'Normal') => {
const buildPStyle = (style = 'Normal') => {
const pStyleFragment = fragment({
namespaceAlias: { w: namespaces.w },
})
.ele('@w', 'pStyle')
.att('@w', 'val', heading)
.att('@w', 'val', style)
.up();

return pStyleFragment;
Expand Down Expand Up @@ -693,10 +693,10 @@ const buildParagraphProperties = (attributes) => {
delete attributes.backgroundColor;
}
break;
case 'heading':
const pStyleFragment = buildPStyle(attributes.heading);
case 'paragraphStyle':
const pStyleFragment = buildPStyle(attributes.paragraphStyle);
paragraphPropertiesFragment.import(pStyleFragment);
delete attributes.heading;
delete attributes.paragraphStyle;
break;
case 'indentation':
const indentationFragment = buildIndentation(attributes[key].left);
Expand Down

0 comments on commit a1c4429

Please sign in to comment.