Repository navigation
v8.7.0
v8.7.0: 📝 OpenDocument Templates, Disclosures & Captions
I am pleased to announce the release of officeParser v8.7.0! Templates fill OpenDocument text files as well as Word files and tell you about text that only looks like a tag, <details> and figure captions survive the trip through HTML and Markdown, note references show their real marks, and a set of fixes keeps small hostile files from growing into huge outputs.
🌟 Key Highlights
1. OpenDocument text templates
OfficeTemplate.render, tags() and check() now fill .odt and .ott templates with the same tags and data as Word's: text split across spans, headers and footers, notes, comments, text boxes, list items and table rows. An .ott renders to an .odt.
const filled = await OfficeTemplate.render('letter.ott', { data });2. Templates that tell you what went wrong
- Text that looks like a tag but is not one (
{{first name}},{{ name }, full-width braces) is listed bytags()and warned once byrender()andcheck()withTEMPLATE_NOT_A_TAG. dataNumberSeparatorsreads numbers written as text with a decimal comma ('1.234,50'), and text that is a number compares with a number in conditions.- A keyword spelt as other template languages spell it (
elseif,end if) carries the fix indetails.suggestion.
3. Disclosures, keyboard input and figure captions
<details>/<summary> is read from HTML and Markdown as a disclosure node with a summary node, written back as such in HTML, EPUB and Markdown and as a bold summary line elsewhere. <kbd> is read as keyboard input, and a <figure>'s caption is read as the picture's (ImageMetadata.caption) and written in every format and image mode.
4. Sheets as document tables
htmlConfig.sheetLayout: 'tables' writes each sheet of a workbook as a heading and a plain table, for pages that embed a workbook in a document.
🔧 Also Fixed
- Note references show the note's mark, not its internal id (
2,ftn1), following ODT's notes configuration. - RTF bullet lists with numbered deeper levels stay bullet lists.
- A quote of several paragraphs stays one quote in HTML, EPUB, Markdown and LaTeX.
- XHTML is read as HTML without a type warning.
- Markdown keeps text it dropped after an empty first list item and in items holding a lone carriage return.
- Small documents can no longer grow into huge outputs through repeated headers, nested text boxes or styled rich strings, and large workbooks of repeated rich text are read whole.
- The native PDF engine and the chunk splitter work in bounded memory on very long paragraphs; the PDF is byte for byte the same.
- LaTeX writes a highlight through one command per colour, about half the size, and highlighted underlined text wraps.
📝 On the blog: Filling an OpenDocument Template, Text That Looks Like a Tag, Reading a Details Block in Markdown the Way GitHub Shows It and How a Document Library Is Tested.
🛠 Getting Started
npm install officeparser@8.7.0🔗 Full Changelog: View v8.7.0 details
🔗 Documentation & Visualizer: officeparser.harshankur.com