docx-to-html
Documentation / lib/components/Editor/docx/docx-to-html
createStyleParser()​
function createStyleParser(styleXML: any): Promise<any>;
Defined in: web-app/src/lib/components/Editor/docx/docx-to-html.js:70
Parameters​
Parameter | Type |
---|---|
|
|
Returns​
Promise
<any
>
createTokenizer()​
function createTokenizer(docXML: string, styleData: any): any[];
Defined in: web-app/src/lib/components/Editor/docx/docx-to-html.js:120
Parses doc xml to tokenize each text range into obj: text: "", format underline, strong, mark
Parameters​
Parameter | Type | Description |
---|---|---|
|
| string from docx unzip |
|
| parsed object of style class names |
Returns​
any
[]
blocks
documentToMarkup()​
function documentToMarkup(filepath: any): Promise<string>;
Defined in: web-app/src/lib/components/Editor/docx/docx-to-html.js:64
1 - open document.xml 2 - tokenize xml 3 - reconstruct cleaned html
Parameters​
Parameter | Type |
---|---|
|
|
Returns​
Promise
<string
>
documentToTokens()​
function documentToTokens(docxInput: string | ArrayBuffer | Blob | File, options: any): Promise<any[]>;
Defined in: web-app/src/lib/components/Editor/docx/docx-to-html.js:16
Converts docx file to array or token objects with text and formatting 1 - open document.xml and styles.xml by unzipping .docx file 2 - tokenize document.xml and pull info on named styles from styles.xml
Parameters​
Parameter | Type | Description |
---|---|---|
|
| File Path, File object, Blob, or ArrayBuffer of a DOCX file |
|
| simplified: boolean |
Returns​
Promise
<any
[]>
Array of token objects with text and formatting