sphinx i18n avoid unusable warnings patch.

  • Download Gist
sphinx-i18n-avoid-unusable-warnings.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
diff -r 8a5db9f7719d -r 02d86c1ce059 sphinx/environment.py
--- a/sphinx/environment.py Tue Nov 27 20:07:30 2012 +0900
+++ b/sphinx/environment.py Thu Nov 29 15:46:57 2012 +0900
@@ -219,6 +219,14 @@
if not msgstr or msgstr == msg: # as-of-yet untranslated
continue
+ # Avoid "Literal block expected; none found." warnings.
+ # If msgstr ends with '::' then it cause warning message at
+ # parser.parse() processing.
+ # literal-block-warning is only appear in avobe case.
+ if msgstr.strip().endswith('::'):
+ msgstr += '\n\n dummy literal'
+ # dummy literal node will discard by 'patch = patch[0]'
+
patch = new_document(source, settings)
parser.parse(msgstr, patch)
patch = patch[0]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.