@@ -99,6 +99,7 @@ export class PDFEasy {
9999 __BACKGROUND_RAW__ : '' ,
100100 } ,
101101 __LAST_TYPE__ : [ 'paragraph' , 0 ] ,
102+ __LAST_CONTENT__ : { } ,
102103 }
103104
104105 private mutateLastType = ( type : ItemType ) => {
@@ -109,6 +110,10 @@ export class PDFEasy {
109110 : [ type , 1 ]
110111 }
111112
113+ private posUpdateContent = ( content : Content ) => {
114+ this . globals . __LAST_CONTENT__ = content
115+ }
116+
112117 private getType = ( content : Content ) : ItemType => {
113118 if ( content . checkbox ) return 'checkbox'
114119 if ( content . list ) return 'list'
@@ -137,17 +142,19 @@ export class PDFEasy {
137142 for ( const content of this . contents ) {
138143 await runPluginBackground ( this )
139144
140- this . mutateLastType ( this . getType ( content ) )
141-
142145 if ( ! this . pdfkit ) return
143146
147+ this . mutateLastType ( this . getType ( content ) )
148+
144149 await resolveContent (
145150 this . pdfkit ,
146151 this . def ,
147152 content ,
148153 this . globals ,
149154 this . optionsRun
150155 )
156+
157+ this . posUpdateContent ( content )
151158 }
152159 }
153160
@@ -171,6 +178,7 @@ export class PDFEasy {
171178 __BACKGROUND_RAW__ : '' ,
172179 } ,
173180 __LAST_TYPE__ : [ 'paragraph' , 1 ] ,
181+ __LAST_CONTENT__ : { } ,
174182 }
175183 }
176184
@@ -290,6 +298,7 @@ export class PDFEasy {
290298 */
291299 public run = ( options ?: RunOptions ) : Promise < string > => {
292300 this . optionsRun = options || { }
301+ this . globals . __LAST_CONTENT__ = this . contents [ 0 ]
293302
294303 const runType = options ?. type || 'client'
295304
0 commit comments