commit e50bcab88c3547e82d1ef452cfeb75aa781ea676 Author: Jeremy Stanley Date: Tue Oct 13 17:54:46 2020 +0000 Don't break long/hyphenated words in RST creation The textwrap module by default breaks hyphenated words across line wrapping boundaries, which Sphinx will then reinterpret as whitespace. Disable this behavior so that hyphenated words will be moved to the next line rather than broken at their hyphens. Also disable a related feature which would break lines longer than the target line length, allowing one-word lines longer than that. Change-Id: I2ce8dcd4d67b658817857167e218913c75df0bda diff --git a/doc/source/_exts/vmt.py b/doc/source/_exts/vmt.py index 1422d6b..3986ec0 100644 --- a/doc/source/_exts/vmt.py +++ b/doc/source/_exts/vmt.py @@ -24,7 +24,8 @@ def to_snake_case(d): def to_paragraphs(d, *args): for k in args: if k in d and isinstance(d[k], str): - d[k] = '\n'.join(textwrap.wrap(d[k])) + d[k] = '\n'.join(textwrap.wrap( + d[k], break_long_words=False, break_on_hyphens=False)) def ossa_date_formatter(value):