@depup/mammoth 1.12.0-depup.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/.eslintrc.json +75 -0
  2. package/.github/ISSUE_TEMPLATE.md +12 -0
  3. package/.github/pull_request_template.md +3 -0
  4. package/.github/workflows/tests.yml +26 -0
  5. package/LICENSE +22 -0
  6. package/NEWS +530 -0
  7. package/README.md +37 -0
  8. package/bin/mammoth +38 -0
  9. package/browser/docx/files.js +14 -0
  10. package/browser/unzip.js +12 -0
  11. package/changes.json +34 -0
  12. package/lib/document-to-html.js +469 -0
  13. package/lib/documents.js +254 -0
  14. package/lib/docx/body-reader.js +798 -0
  15. package/lib/docx/comments-reader.js +31 -0
  16. package/lib/docx/content-types-reader.js +58 -0
  17. package/lib/docx/document-xml-reader.js +30 -0
  18. package/lib/docx/docx-reader.js +226 -0
  19. package/lib/docx/files.js +80 -0
  20. package/lib/docx/notes-reader.js +28 -0
  21. package/lib/docx/numbering-xml.js +111 -0
  22. package/lib/docx/office-xml-reader.js +73 -0
  23. package/lib/docx/relationships-reader.js +43 -0
  24. package/lib/docx/style-map.js +75 -0
  25. package/lib/docx/styles-reader.js +90 -0
  26. package/lib/docx/uris.js +21 -0
  27. package/lib/html/ast.js +51 -0
  28. package/lib/html/index.js +41 -0
  29. package/lib/html/simplify.js +88 -0
  30. package/lib/images.js +31 -0
  31. package/lib/index.d.ts +86 -0
  32. package/lib/index.js +111 -0
  33. package/lib/main.js +63 -0
  34. package/lib/options-reader.js +107 -0
  35. package/lib/promises.js +42 -0
  36. package/lib/raw-text.js +14 -0
  37. package/lib/results.js +72 -0
  38. package/lib/style-reader.js +365 -0
  39. package/lib/styles/document-matchers.js +100 -0
  40. package/lib/styles/html-paths.js +75 -0
  41. package/lib/styles/parser/tokeniser.js +30 -0
  42. package/lib/transforms.js +62 -0
  43. package/lib/underline.js +11 -0
  44. package/lib/unzip.js +20 -0
  45. package/lib/writers/html-writer.js +159 -0
  46. package/lib/writers/index.js +14 -0
  47. package/lib/writers/markdown-writer.js +163 -0
  48. package/lib/xml/index.js +8 -0
  49. package/lib/xml/nodes.js +70 -0
  50. package/lib/xml/reader.js +69 -0
  51. package/lib/xml/writer.js +61 -0
  52. package/lib/xml/xmldom.js +23 -0
  53. package/lib/zipfile.js +72 -0
  54. package/mammoth.browser.js +22096 -0
  55. package/mammoth.browser.min.js +20 -0
  56. package/package.json +106 -0
  57. package/test/.eslintrc.json +7 -0
  58. package/test/document-to-html.tests.js +892 -0
  59. package/test/docx/body-reader.tests.js +2037 -0
  60. package/test/docx/comments-reader.tests.js +53 -0
  61. package/test/docx/content-types-reader.tests.js +45 -0
  62. package/test/docx/document-matchers.js +42 -0
  63. package/test/docx/document-xml-reader.tests.js +41 -0
  64. package/test/docx/docx-reader.tests.js +179 -0
  65. package/test/docx/files.tests.js +107 -0
  66. package/test/docx/notes-reader.tests.js +36 -0
  67. package/test/docx/numbering-xml.tests.js +183 -0
  68. package/test/docx/office-xml-reader.tests.js +41 -0
  69. package/test/docx/relationships-reader.tests.js +65 -0
  70. package/test/docx/style-map.tests.js +113 -0
  71. package/test/docx/styles-reader.tests.js +143 -0
  72. package/test/docx/testing.js +12 -0
  73. package/test/docx/uris.tests.js +22 -0
  74. package/test/html/simplify.tests.js +141 -0
  75. package/test/html/write.tests.js +42 -0
  76. package/test/images.tests.js +112 -0
  77. package/test/main.tests.js +89 -0
  78. package/test/mammoth.tests.js +523 -0
  79. package/test/mocha.opts +1 -0
  80. package/test/options-reader.tests.js +63 -0
  81. package/test/raw-text.tests.js +61 -0
  82. package/test/results.tests.js +15 -0
  83. package/test/style-reader.tests.js +291 -0
  84. package/test/styles/document-matchers.tests.js +91 -0
  85. package/test/styles/html-paths.tests.js +20 -0
  86. package/test/styles/parser/tokeniser.tests.js +104 -0
  87. package/test/test-data/comments.docx +0 -0
  88. package/test/test-data/embedded-style-map.docx +0 -0
  89. package/test/test-data/empty.docx +0 -0
  90. package/test/test-data/empty.zip +0 -0
  91. package/test/test-data/endnotes.docx +0 -0
  92. package/test/test-data/external-picture.docx +0 -0
  93. package/test/test-data/footnote-hyperlink.docx +0 -0
  94. package/test/test-data/footnotes.docx +0 -0
  95. package/test/test-data/hello.zip +0 -0
  96. package/test/test-data/hyperlinks/word/_rels/document.xml.rels +10 -0
  97. package/test/test-data/hyperlinks/word/document.xml +18 -0
  98. package/test/test-data/simple/word/document.xml +18 -0
  99. package/test/test-data/simple-list.docx +0 -0
  100. package/test/test-data/single-paragraph.docx +0 -0
  101. package/test/test-data/strict-format.docx +0 -0
  102. package/test/test-data/strikethrough.docx +0 -0
  103. package/test/test-data/tables.docx +0 -0
  104. package/test/test-data/text-box.docx +0 -0
  105. package/test/test-data/tiny-picture-target-base-relative.docx +0 -0
  106. package/test/test-data/tiny-picture.docx +0 -0
  107. package/test/test-data/tiny-picture.png +0 -0
  108. package/test/test-data/underline.docx +0 -0
  109. package/test/test-data/utf8-bom.docx +0 -0
  110. package/test/test.js +11 -0
  111. package/test/testing.js +55 -0
  112. package/test/transforms.tests.js +125 -0
  113. package/test/unzip.tests.js +38 -0
  114. package/test/writers/html-writer.tests.js +133 -0
  115. package/test/writers/markdown-writer.tests.js +304 -0
  116. package/test/xml/reader.tests.js +85 -0
  117. package/test/xml/writer.tests.js +81 -0
  118. package/test/zipfile.tests.js +61 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "extends": "eslint:recommended",
3
+
4
+ "rules": {
5
+ "curly": ["error", "all"],
6
+ "dot-location": ["error", "property"],
7
+ "no-alert": ["error"],
8
+ "no-caller": ["error"],
9
+ "no-eval": ["error"],
10
+ "no-extend-native": ["error"],
11
+ "no-extra-bind": ["error"],
12
+ "no-extra-label": ["error"],
13
+ "no-floating-decimal": ["error"],
14
+ "no-implicit-coercion": ["error", {"allow": ["!!"]}],
15
+ "no-implied-eval": ["error"],
16
+ "no-invalid-this": ["error"],
17
+ "no-labels": ["error"],
18
+ "no-lone-blocks": ["error"],
19
+ "no-native-reassign": ["error"],
20
+ "no-new": ["error"],
21
+ "no-new-func": ["error"],
22
+ "no-new-wrappers": ["error"],
23
+ "no-return-assign": ["error"],
24
+ "no-self-compare": ["error"],
25
+ "no-sequences": ["error"],
26
+ "no-throw-literal": ["error"],
27
+ "no-unused-expressions": ["error"],
28
+ "no-useless-call": ["error"],
29
+ "no-with": ["error"],
30
+ "no-unused-vars": ["error", {"args": "none"}],
31
+ "object-curly-spacing": ["error", "never"],
32
+ "radix": ["error", "always"],
33
+
34
+ "array-bracket-spacing": ["error", "never"],
35
+ "brace-style": ["error", "1tbs"],
36
+ "camelcase": ["error"],
37
+ "comma-spacing": ["error", {"before": false, "after": true}],
38
+ "comma-style": ["error", "last"],
39
+ "computed-property-spacing": ["error", "never"],
40
+ "eol-last": ["error"],
41
+ "indent": ["error", 4],
42
+ "key-spacing": [
43
+ "error",
44
+ {"beforeColon": false, "afterColon": true, "mode": "strict"}
45
+ ],
46
+ "keyword-spacing": ["error", {"before": true, "after": true}],
47
+ "new-parens": ["error"],
48
+ "no-array-constructor": ["error"],
49
+ "no-continue": ["error"],
50
+ "no-lonely-if": ["error"],
51
+ "no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 1}],
52
+ "no-new-object": ["error"],
53
+ "no-spaced-func": ["error"],
54
+ "no-trailing-spaces": ["error", {"skipBlankLines": true}],
55
+ "no-whitespace-before-property": ["error"],
56
+ "one-var": ["error", "never"],
57
+ "semi": ["error", "always"],
58
+ "semi-spacing": ["error", {"before": false}],
59
+ "space-before-function-paren": ["error", "never"],
60
+ "space-in-parens": ["error", "never"],
61
+ "space-infix-ops": ["error"],
62
+ "space-unary-ops": ["error", {"words": true, "nonwords": false}],
63
+ "spaced-comment": ["error", "always"]
64
+ },
65
+
66
+ "globals": {
67
+ "Buffer": false,
68
+ "console": true,
69
+ "exports": true,
70
+ "module": true,
71
+ "require": false,
72
+ "TextDecoder": false,
73
+ "Uint8Array": false
74
+ }
75
+ }
@@ -0,0 +1,12 @@
1
+ If you're reporting a bug or requesting a feature, please include:
2
+ * a minimal example document
3
+ * the HTML output that you'd expect
4
+
5
+ If you're reporting a bug, it's also useful to know what platform you're
6
+ running on, including:
7
+
8
+ * the operating system and version
9
+ * if running in the browser:
10
+ * the browser and version
11
+ * whether you get the same issue in other browsers
12
+ * if running on node.js, the version you're using
@@ -0,0 +1,3 @@
1
+ In general, pull requests are not currently accepted.
2
+
3
+ Please instead submit an issue if you find a bug or would like to request a feature.
@@ -0,0 +1,26 @@
1
+ name: Tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ node-version: ["12", "14", "16"]
12
+
13
+ steps:
14
+
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Use Node.js ${{ matrix.node-version }}
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+
22
+ - run: npm install
23
+
24
+ - run: npm test
25
+
26
+ - run: npm run check-typescript
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013, Michael Williamson
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/NEWS ADDED
@@ -0,0 +1,530 @@
1
+ # 1.12.0
2
+
3
+ * Handle hyperlinked wp:anchor and wp:inline elements.
4
+
5
+ * Handle hyperlink complex fields with unquoted hrefs.
6
+
7
+ # 1.11.0
8
+
9
+ * Ignore style definitions using a style ID that has already been used.
10
+
11
+ * Disable external file accesses by default. External file access can be enabled
12
+ using the externalFileAccess option.
13
+
14
+ * Handle numbering levels defined without an index.
15
+
16
+ # 1.10.0
17
+
18
+ * Add "Heading" and "Body" styles, as found in documents created by Apple Pages,
19
+ to the default style map.
20
+
21
+ * Handle structured document tags representing checkboxes wrapped in other
22
+ elements, such as table cells. Previously, the wrapping elements would have
23
+ been ignored.
24
+
25
+ * Ignore deleted table rows.
26
+
27
+ * Add notes on security.
28
+
29
+ * Revert the change to explicitly use commonjs modules. This appeared to cause
30
+ issues with some bundlers such as webpack when using mammoth.browser.js.
31
+
32
+ # 1.9.1
33
+
34
+ * Ignore AlternateContent elements when there is no Fallback element.
35
+
36
+ * Explicitly use commonjs modules. Since the modules should have previously been
37
+ implicitly treated as commonjs modules, this shouldn't affect behaviour.
38
+
39
+ # 1.9.0
40
+
41
+ * Update lop to 0.4.2, which removes the use of the util module when there are
42
+ errors during parsing. This should remove the need to polyfill util in the
43
+ browser.
44
+
45
+ * Detect checkboxes, both as complex fields and structured document tags, and
46
+ convert them to checkbox inputs.
47
+
48
+ # 1.8.0
49
+
50
+ * Add style mapping for highlights.
51
+
52
+ # 1.7.2
53
+
54
+ * Remove the use of the path module from common code used by browser builds.
55
+ This should remove the need to polyfill path in the browser.
56
+
57
+ # 1.7.1
58
+
59
+ * Handle numbering level definitions without an explicit format.
60
+
61
+ * Switch the precedence of numbering properties in paragraph properties and the
62
+ numbering in paragraph styles so that the numbering properties in paragraph
63
+ properties takes precedence.
64
+
65
+ # 1.7.0
66
+
67
+ * Support attributes in HTML paths in style mappings.
68
+
69
+ * Improve error message when failing to find the body element in a document.
70
+
71
+ * Add support for the strict document format.
72
+
73
+ # 1.6.0
74
+
75
+ * Add transformDocument to the TypeScript declarations.
76
+
77
+ * Support merged paragraphs when revisions are tracked.
78
+
79
+ * Use xmldom instead of sax to parse XML documents. This should remove the need
80
+ to polyfill stream in the browser.
81
+
82
+ * Adjust the internal implementation to remove the use of Buffer on the critical
83
+ path, and provide APIs to read images and documents with embedded style maps
84
+ without using Buffer. This should remove the need to polyfill Buffer in the
85
+ browser. Since TextDecoder is now used, the minimum version of node.js is now
86
+ v12.
87
+
88
+ * Remove the use of the util module. This should remove the need to polyfill
89
+ util in the browser.
90
+
91
+ # 1.5.1
92
+
93
+ * Fix: npm 7 changed the behaviour of prepublish, causing the browser build not
94
+ to be updated before publishing to npm. We now use prepare instead of
95
+ prepublish, which has the same behaviour that prepublish previously had.
96
+
97
+ # 1.5.0
98
+
99
+ * Only use the alt text of image elements as a fallback. If an alt attribute is
100
+ returned from the function passed to mammoth.images.imgElement, that value
101
+ will now be preferred to the alt text of the image element.
102
+
103
+ # 1.4.21
104
+
105
+ * Ignore w:u elements when w:val is missing.
106
+
107
+ # 1.4.20
108
+
109
+ * Emit warning instead of throwing exception when image file cannot be found for
110
+ a:blip elements.
111
+
112
+ # 1.4.19
113
+
114
+ * Add TypeScript declarations.
115
+
116
+ # 1.4.18
117
+
118
+ * When extracting raw text, convert tab elements to tab characters.
119
+
120
+ * Handle internal hyperlinks created with complex fields.
121
+
122
+ * Update JSZip to 3.2.0. This addresses CVE-2021-23413 in JSZip.
123
+
124
+ # 1.4.17
125
+
126
+ * Handle w:num with invalid w:abstractNumId.
127
+ * Update underscore to 1.13.1.
128
+
129
+ # 1.4.16
130
+
131
+ * Convert symbols in supported fonts to corresponding Unicode characters.
132
+
133
+ # 1.4.15
134
+
135
+ * Support numbering defined by paragraph style.
136
+
137
+ # 1.4.14
138
+
139
+ * Add style mapping for all caps.
140
+
141
+ # 1.4.13
142
+
143
+ * Use package-lock.json instead of npm-shrinkwrap.json.
144
+
145
+ # 1.4.12
146
+
147
+ * Handle underline elements where w:val is "none".
148
+
149
+ # 1.4.11
150
+
151
+ * Re-publishing to remove superfluous files.
152
+
153
+ # 1.4.10
154
+
155
+ * Read font size for runs.
156
+ * Support soft hyphens.
157
+
158
+ # 1.4.9
159
+
160
+ * Allow hyperlinks to be collapsed.
161
+
162
+ # 1.4.8
163
+
164
+ * Improve list support by following w:numStyleLink in w:abstractNum.
165
+
166
+ # 1.4.7
167
+
168
+ * Update xmlbuilder dependency.
169
+
170
+ # 1.4.6
171
+
172
+ * Fix: default style mappings caused footnotes, endnotes and comments
173
+ containing multiple paragraphs to be converted into a single paragraph.
174
+
175
+ # 1.4.5
176
+
177
+ * When using the pretty HTML writer, don't format HTML inside pre elements.
178
+
179
+ * Read the children of v:rect elements.
180
+
181
+ # 1.4.4
182
+
183
+ * Parse paragraph indents.
184
+
185
+ * Read part paths using relationships. This improves support for documents
186
+ created by Word Online.
187
+
188
+ # 1.4.3
189
+
190
+ * Add style mapping for small caps.
191
+
192
+ * Add style mapping for tables.
193
+
194
+ # 1.4.2
195
+
196
+ * Read children of v:group elements.
197
+
198
+ # 1.4.1
199
+
200
+ * Read w:noBreakHyphen elements as non-breaking hyphen characters.
201
+
202
+ # 1.4.0
203
+
204
+ * Extract the default data URI image converter to the images module.
205
+
206
+ * Add anchor on hyperlinks as fragment if present.
207
+
208
+ * Convert target frames on hyperlinks to targets on anchors.
209
+
210
+ * Detect header rows in tables and convert to thead > tr > th.
211
+
212
+ # 1.3.6
213
+
214
+ * Handle complex fields that do not have a "separate" fldChar.
215
+
216
+ # 1.3.5
217
+
218
+ * Add transforms.run.
219
+
220
+ # 1.3.4
221
+
222
+ * Read children of w:object elements.
223
+
224
+ # 1.3.3
225
+
226
+ * Handle hyperlinks created with complex fields.
227
+
228
+ # 1.3.2
229
+
230
+ * Handle absolute paths within zip files. This should fix an issue where some
231
+ images within a document couldn't be found.
232
+
233
+ # 1.3.1
234
+
235
+ * Add getDescendants() and getDescendantsOfType() to transforms module.
236
+
237
+ * Add font property to runs.
238
+
239
+ # 1.3.0
240
+
241
+ * Allow style names to be mapped by prefix. For instance:
242
+
243
+ r[style-name^='Code '] => code
244
+
245
+ * Add default style mappings for Heading 5 and Heading 6.
246
+
247
+ * Allow escape sequences in style IDs, style names and CSS class names.
248
+
249
+ * Allow a separator to be specified when HTML elements are collapsed.
250
+
251
+ * Add includeEmbeddedStyleMap option to allow embedded style maps to be
252
+ disabled.
253
+
254
+ * Include embedded styles when explicit style map is passed.
255
+
256
+ # 1.2.5
257
+
258
+ * Ignore bold, italic, underline and strikethrough elements that have a value of
259
+ false or 0.
260
+
261
+ # 1.2.4
262
+
263
+ * Ignore v:imagedata elements without relationship ID with warning.
264
+
265
+ # 1.2.3
266
+
267
+ * Expect end token when parsing style mappings. This causes warnings to be
268
+ emitted instead of silenting ignoring unparsed tokens.
269
+
270
+ # 1.2.2
271
+
272
+ * Ignore blank lines in style map.
273
+
274
+ # 1.2.1
275
+
276
+ * Use alt text title as alt text for images when the alt text description is
277
+ missing entirely.
278
+
279
+ # 1.2.0
280
+
281
+ * Throw more informative error when word/document.xml cannot be found.
282
+
283
+ * Generate messages of type "error" instead of "warning" when image conversion
284
+ throws an exception.
285
+
286
+ * Use alt text title as alt text for images when the alt text description is
287
+ blank.
288
+
289
+ # 1.1.0
290
+
291
+ * Add support for comments.
292
+
293
+ # 1.0.4
294
+
295
+ * Add support for w:sdt elements. This allows the bodies of content controls,
296
+ such as bibliographies, to be converted.
297
+
298
+ * Avoid stack overflows when elements have many children.
299
+
300
+ # 1.0.3
301
+
302
+ * Actually add support for table cells spanning multiple rows.
303
+
304
+ # 1.0.2
305
+
306
+ * Add support for table cells spanning multiple rows.
307
+
308
+ # 1.0.1
309
+
310
+ * Add support for table cells spanning multiple columns.
311
+
312
+ # 1.0.0
313
+
314
+ * Remove deprecated convertUnderline option.
315
+
316
+ * Officially support ID prefixes.
317
+
318
+ * Generated IDs no longer insert a hyphen after the ID prefix.
319
+
320
+ * The default ID prefix is now the empty string rather than a random number
321
+ followed by a hyphen.
322
+
323
+ * Rename mammoth.images.inline to mammoth.images.imgElement to better reflect
324
+ its behaviour.
325
+
326
+ # 0.3.33
327
+
328
+ * Improve collapsing of elements when there are empty elements.
329
+
330
+ # 0.3.32
331
+
332
+ * Allow bold and italic style mappings to be configured.
333
+
334
+ # 0.3.31
335
+
336
+ * Handle references to missing styles when reading documents.
337
+
338
+ # 0.3.30
339
+
340
+ * Improve support for lists made in LibreOffice. Specifically, this changes the
341
+ default style mapping for paragraphs with a style of "Normal" to have the
342
+ lowest precedence.
343
+
344
+ * Replace nomnom with argparse for CLI argument parsing. Usage should be the
345
+ same, but unknown arguments will now cause an exit with failure rather than
346
+ being ignored.
347
+
348
+ # 0.3.29
349
+
350
+ * Always use mc:Fallback when reading mc:AlternateContent elements.
351
+
352
+ # 0.3.28
353
+
354
+ * Avoid inserting newlines around inline elements when pretty-printing HTML.
355
+
356
+ * CLI: print warnings to stderr.
357
+
358
+ * Read v:imagedata with r:id attribute.
359
+
360
+ * Read children of v:roundrect.
361
+
362
+ * Ignore office-word:wrap, v:shadow and v:shapetype.
363
+
364
+ # 0.3.27
365
+
366
+ * Fix recursive collapsing of elements.
367
+
368
+ # 0.3.26
369
+
370
+ * Keep HTML elements open correctly when the HTML path contains no fresh
371
+ element.
372
+
373
+ * Collapse similar non-fresh HTML elements together.
374
+
375
+ * Don't escape double quotes outside of attributes.
376
+
377
+ # 0.3.25
378
+
379
+ * When the styleMap option is passed as a string, ignore lines beginning with #.
380
+
381
+ * Generate warnings for not-understood style mappings and continue, rather than
382
+ stopping with an error.
383
+
384
+ * Add support for embedded style maps.
385
+
386
+ * Add support for linked images.
387
+
388
+ # 0.3.24
389
+
390
+ * Ignore w:numPr elements without w:numId or w:ilvl children.
391
+
392
+ # 0.3.23
393
+
394
+ * Support links and images in footnotes and endnotes.
395
+
396
+ # 0.3.22
397
+
398
+ * Add support for underlines in style map.
399
+
400
+ * Add support for strikethrough.
401
+
402
+ # 0.3.21
403
+
404
+ * Add basic support for text boxes. The contents of the text box are treated as
405
+ a separate paragraph that appears after the paragraph containing the text box.
406
+
407
+ # 0.3.20
408
+
409
+ * Support styles defined without a name
410
+
411
+ # 0.3.19
412
+
413
+ * Add ignoreEmptyParagraphs option, which defaults to true.
414
+
415
+ # 0.3.18
416
+
417
+ * Make style names case-insensitive in style mappings. This should make style
418
+ mappings easier to write, especially since Microsoft Word sometimes represents
419
+ style names in the UI differently from in the style definition. For instance,
420
+ the style displayed in Word as "Heading 1" has a style name of "heading 1".
421
+ This hopefully shouldn't cause an issue for anyone, but if you were relying
422
+ on case-sensitivity, please do get in touch.
423
+
424
+ # 0.3.17
425
+
426
+ * Add support for hyperlinks to bookmarks in the same document.
427
+
428
+ # 0.3.16
429
+
430
+ * Add basic support for Markdown. Not all features are currently supported.
431
+
432
+ # 0.3.15
433
+
434
+ * Add default style mappings for builtin footnote and endnote styles in
435
+ Microsoft Word and LibreOffice.
436
+
437
+ * Allow style mappings with a zero-element HTML path.
438
+
439
+ * Emit warnings when image types are unlikely to be supported by web browsers.
440
+
441
+ * Update jszip to 2.4.0.
442
+
443
+ # 0.3.14
444
+
445
+ * Add support for endnotes.
446
+
447
+ # 0.3.13
448
+
449
+ * Update license-sniffer to fix license comments in mammoth.browser.js.
450
+
451
+ # 0.3.12
452
+
453
+ * Update bluebird dependency to fix operation in web workers.
454
+
455
+ # 0.3.11
456
+
457
+ * Add support for superscript and subscript text.
458
+
459
+ # 0.3.10
460
+
461
+ * Handle XML files that start with the UTF-8 BOM.
462
+
463
+ # 0.3.9
464
+
465
+ * Add support for reading Buffer instances.
466
+
467
+ # 0.3.8
468
+
469
+ * Add support for line breaks.
470
+
471
+ # 0.3.7
472
+
473
+ * Add optional underline conversion.
474
+
475
+ # 0.3.6
476
+
477
+ * Add helper `mammoth.transforms.paragraph`.
478
+
479
+ # 0.3.5
480
+
481
+ * Add `mammoth.images.inline`, and document custom image conversion.
482
+
483
+ # 0.3.4
484
+
485
+ * Add the function `mammoth.extractRawText`.
486
+
487
+ # 0.3.3
488
+
489
+ * Add support for tables.
490
+
491
+ # 0.3.2
492
+
493
+ * Add support for footnotes.
494
+
495
+ # 0.3.1
496
+
497
+ * Fix: all non-paragraph styles are treated as character styles when reading
498
+ styles from a docx document.
499
+
500
+ # 0.3.0
501
+
502
+ * Rename the existing concept of a "style name" to "style ID" to correspond to
503
+ the terminology used internally in docx files. Any document transforms that
504
+ get or set the `styleName` property should use the `styleId` property instead.
505
+
506
+ * Allow paragraphs and runs to be matched by style name. For instance, to match
507
+ a paragraph with the style name `Heading 1`:
508
+
509
+ p[style-name='Heading 1']
510
+
511
+ * Use an array of raw strings rather than an array of style mappings when
512
+ passing options to convertToHtml.
513
+
514
+ * Add support for node 0.11 (tested on node 0.11.13).
515
+
516
+ # 0.2.2
517
+
518
+ * Fix: exception when bad arguments are passed into unzip.openZip.
519
+
520
+ # 0.2.1
521
+
522
+ * Fix browserify support.
523
+
524
+ # 0.2.0
525
+
526
+ * Rename mammoth.style() to mammoth.styleMapping().
527
+
528
+ * Add support for document transforms.
529
+
530
+ * Append standard style map to custom style map unless explicitly excluded.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @depup/mammoth
2
+
3
+ > Dependency-bumped version of [mammoth](https://www.npmjs.com/package/mammoth)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/mammoth
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [mammoth](https://www.npmjs.com/package/mammoth) @ 1.12.0 |
17
+ | Processed | 2026-07-21 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 7 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | @xmldom/xmldom | ^0.8.6 | ^0.9.10 |
26
+ | argparse | ~1.0.3 | ^3.0.0 |
27
+ | bluebird | ~3.4.0 | ^3.7.2 |
28
+ | jszip | ^3.7.1 | ^3.10.1 |
29
+ | path-is-absolute | ^1.0.0 | ^2.0.0 |
30
+ | underscore | ^1.13.1 | ^1.13.8 |
31
+ | xmlbuilder | ^10.0.0 | ^15.1.1 |
32
+
33
+ ---
34
+
35
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/mammoth
36
+
37
+ License inherited from the original package.