aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 90d85a6..3e8d3a1 100644
--- a/README.md
+++ b/README.md
@@ -544,10 +544,12 @@ var options = {
Or if you want paragraphs that have been explicitly set to use monospace fonts to represent code:
```javascript
+const monospaceFonts = ["consolas", "courier"];
+
function transformParagraph(paragraph) {
var runs = mammoth.transforms.getDescendantsOfType(paragraph, "run");
var isMatch = runs.length > 0 && runs.every(function(run) {
- return run.font && fonts.indexOf(run.font.toLowerCase()) !== -1;
+ return run.font && monospaceFonts.indexOf(run.font.toLowerCase()) !== -1;
});
if (isMatch) {
return {