File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
packages/markdown-docx/src Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,19 @@ const definedNodes = {
30
30
emphasize : 'org.accordproject.commonmark.Emph' ,
31
31
} ;
32
32
33
- let globalOOXML = '' ;
34
-
35
33
/**
36
34
* Transforms the ciceromark to OOXML
37
35
*/
38
36
class CiceroMarkToOOXMLTransfomer {
39
37
38
+
39
+ /**
40
+ * Declares the OOXML variable
41
+ */
42
+ constructor ( ) {
43
+ this . globalOOXML = '' ;
44
+ }
45
+
40
46
/**
41
47
* Gets the class of a given CiceroMark node.
42
48
*
@@ -77,7 +83,7 @@ class CiceroMarkToOOXMLTransfomer {
77
83
node . nodes . forEach ( subNode => {
78
84
ooxml += this . getNodes ( subNode , counter , ) ;
79
85
} ) ;
80
- globalOOXML = `${ globalOOXML } <w:p>${ ooxml } </w:p>` ;
86
+ this . globalOOXML = `${ this . globalOOXML } <w:p>${ ooxml } </w:p>` ;
81
87
}
82
88
return '' ;
83
89
}
@@ -91,12 +97,12 @@ class CiceroMarkToOOXMLTransfomer {
91
97
* @returns {string } Converted OOXML string i.e. CicecoMark->OOXML
92
98
*/
93
99
toOOXML ( ciceromark , counter , ooxml = '' ) {
94
- globalOOXML = ooxml ;
100
+ this . globalOOXML = ooxml ;
95
101
ciceromark . nodes . forEach ( node => {
96
102
this . getNodes ( node , counter ) ;
97
103
} ) ;
98
- globalOOXML = wrapAroundDefaultDocxTags ( globalOOXML ) ;
99
- return globalOOXML ;
104
+ this . globalOOXML = wrapAroundDefaultDocxTags ( this . globalOOXML ) ;
105
+ return this . globalOOXML ;
100
106
}
101
107
}
102
108
You can’t perform that action at this time.
0 commit comments