File tree Expand file tree Collapse file tree
examples/vue-fields-example
packages/super-editor/src/core/super-converter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 "preview" : " vite preview"
1010 },
1111 "dependencies" : {
12- "@harbour-enterprises/superdoc" : " ^0.11.8 " ,
12+ "@harbour-enterprises/superdoc" : " ^0.11.11 " ,
1313 "vue" : " ^3.5.13"
1414 },
1515 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ const init = (fileToLoad) => {
2121 // Enable pagination
2222 pagination: true ,
2323
24+ // Enable annotation import
25+ annotations: true ,
26+
2427 document : fileToLoad ? { data: fileToLoad } : sampleDocument,
2528
2629 // Initialize the toolbar
@@ -113,6 +116,10 @@ const addField = (field) => {
113116 editor .value .commands .addFieldAnnotationAtSelection (field);
114117}
115118
119+ const exportDocx = () => {
120+ superdoc .value ? .export ();
121+ };
122+
116123const onDragStart = (event ) => {
117124
118125 const getField = (id ) => {
@@ -158,8 +165,11 @@ onMounted(() => init());
158165 value= " <p>Custom <b>Node</b> Content</p>"
159166 >< / textarea>
160167
168+ < br / >
161169 < button class = " custom-button" @click= " setEditable" > Set editable< / button>
162170 < button class = " custom-button" @click= " setViewing" > Set viewing< / button>
171+ < br / >
172+ < button class = " custom-button" @click= " exportDocx" > Export docx< / button>
163173 < / div>
164174 < / div>
165175 < / div>
Original file line number Diff line number Diff line change @@ -1735,7 +1735,7 @@ function prepareHtmlAnnotation(params) {
17351735 } = params ;
17361736
17371737 const parser = new window . DOMParser ( ) ;
1738- const paragraphHtml = parser . parseFromString ( attrs . rawHtml , 'text/html' ) ;
1738+ const paragraphHtml = parser . parseFromString ( attrs . rawHtml || attrs . displayLabel , 'text/html' ) ;
17391739
17401740 const state = EditorState . create ( {
17411741 doc : PMDOMParser . fromSchema ( params . editorSchema ) . parse ( paragraphHtml ) ,
You can’t perform that action at this time.
0 commit comments