Skip to content

Commit

Permalink
fix: removed code made redundant with heading styles
Browse files Browse the repository at this point in the history
  • Loading branch information
privateOmega committed Mar 20, 2021
1 parent a1c4429 commit 48da1dc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions src/helpers/render-document-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { fragment } from 'xmlbuilder2';
// eslint-disable-next-line import/no-cycle
import * as xmlBuilder from './xml-builder';
import namespaces from './namespaces';
import { pixelToHIP, defaultHeadingSizesInPixel } from '../utils/unit-conversion';

const VNode = require('virtual-dom/vnode/vnode');
const VText = require('virtual-dom/vnode/vtext');
Expand Down Expand Up @@ -169,15 +168,9 @@ function findXMLEquivalent(docxDocumentInstance, vNode, xmlFragment) {
case 'h4':
case 'h5':
case 'h6':
const fontSize = pixelToHIP(defaultHeadingSizesInPixel[vNode.tagName]);
const lineHeight = xmlBuilder.fixupLineHeight(1, fontSize);
const headingFragment = xmlBuilder.buildParagraph(
vNode,
{
fontSize,
lineHeight: Math.max(lineHeight, 240),
strong: 'bold',
beforeSpacing: 240,
paragraphStyle: `Heading${vNode.tagName[1]}`,
},
docxDocumentInstance
Expand Down
9 changes: 0 additions & 9 deletions src/utils/unit-conversion.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
export const defaultHeadingSizesInPixel = {
h1: 32,
h2: 24,
h3: 18.72,
h4: 16,
h5: 13.28,
h6: 10.72,
};

export const pixelRegex = /([\d.]+)px/i;
export const percentageRegex = /([\d.]+)%/i;
export const pointRegex = /(\d+)pt/i;
Expand Down

0 comments on commit 48da1dc

Please sign in to comment.