File tree 3 files changed +16
-11
lines changed
3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 28
28
node-version : 18
29
29
registry-url : https://registry.npmjs.org/
30
30
- run : npm ci
31
- - run : npm run build
31
+ - run : npm run build
32
32
- run : npm publish --access public
33
33
env :
34
34
NODE_AUTH_TOKEN : ${{secrets.npm_token}}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @turbodocx/html-to-docx" ,
3
- "version" : " 1.9.4 " ,
3
+ "version" : " 1.9.3 " ,
4
4
"description" : " HTML to DOCX converter" ,
5
5
"keywords" : [
6
6
" html" ,
41
41
42
42
" hlerebours" ,
43
43
" hakjeri" ,
44
- " tasola"
44
+ " tasola" ,
45
+ " AmitSharma512"
45
46
],
46
47
"license" : " MIT" ,
47
48
"bugs" : {
Original file line number Diff line number Diff line change @@ -124,14 +124,18 @@ class DocxDocument {
124
124
this . width = isPortraitOrientation ? width : height ;
125
125
this . height = isPortraitOrientation ? height : width ;
126
126
127
- const marginsObject = properties . margins ;
128
- this . margins =
129
- // eslint-disable-next-line no-nested-ternary
130
- marginsObject && Object . keys ( marginsObject ) . length
131
- ? marginsObject
132
- : isPortraitOrientation
133
- ? portraitMargins
134
- : landscapeMargins ;
127
+ const defaultMargins = isPortraitOrientation ? portraitMargins : landscapeMargins ;
128
+ const marginsObject = properties . margins || { } ;
129
+
130
+ this . margins = {
131
+ top : marginsObject . top !== undefined ? marginsObject . top : defaultMargins . top ,
132
+ right : marginsObject . right !== undefined ? marginsObject . right : defaultMargins . right ,
133
+ bottom : marginsObject . bottom !== undefined ? marginsObject . bottom : defaultMargins . bottom ,
134
+ left : marginsObject . left !== undefined ? marginsObject . left : defaultMargins . left ,
135
+ header : marginsObject . header !== undefined ? marginsObject . header : defaultMargins . header ,
136
+ footer : marginsObject . footer !== undefined ? marginsObject . footer : defaultMargins . footer ,
137
+ gutter : marginsObject . gutter !== undefined ? marginsObject . gutter : defaultMargins . gutter ,
138
+ } ;
135
139
136
140
this . availableDocumentSpace = this . width - this . margins . left - this . margins . right ;
137
141
this . title = properties . title || '' ;
You can’t perform that action at this time.
0 commit comments