aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-04-03 18:50:22 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-03 18:50:22 +0100
commita22b48bb0ee1bd3411419c4c96c2b6d753bc2937 (patch)
tree56d8532bbb966dc955df6a907a10dcb4469df721 /README.md
parent4f201e920f95c675904033c91cf6b616b0fdf870 (diff)
Make font example case-insensitive
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index a30e36d..7e841a7 100644
--- a/README.md
+++ b/README.md
@@ -408,11 +408,11 @@ Or if you want paragraphs that have been explicitly set to use monospace fonts t
import mammoth.documents
import mammoth.transforms
-_monospace_fonts = set(["Courier New"])
+_monospace_fonts = set(["courier new"])
def transform_paragraph(paragraph):
runs = mammoth.transforms.get_descendants_of_type(paragraph, mammoth.documents.Run)
- if runs and all(run.font in _monospace_fonts for run in runs):
+ if runs and all(run.font and run.font.lower() in _monospace_fonts for run in runs):
return paragraph.copy(style_id="code", style_name="Code")
else:
return paragraph