Merge pull request #2938 from jfbu/allowcodebreaksatcommas

Fix #2873: code-block overflow in latex (due to commas)
This commit is contained in:
Takeshi KOMIYA 2016-09-05 10:55:57 +09:00 committed by GitHub
commit 5a02c6162b
2 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ Bugs fixed
* #2917: inline code is hyphenated on HTML
* #1462: autosummary warns for namedtuple with attribute with trailing underscore
* Could not reference equations if ``:nowrap:`` option specified
* #2873: code-block overflow in latex (due to commas)
Release 1.4.6 (released Aug 20, 2016)
=====================================

View File

@ -290,6 +290,7 @@
\def\PYGZti{\discretionary{\char`\~}{\sphinxafterbreak}{\char`\~}}%
}
\def\sphinx@verbatim@nolig@list {\do \`}%
% Some characters . , ; ? ! / are not pygmentized.
% This macro makes them "active" and they will insert potential linebreaks
\newcommand*\sphinxbreaksatpunct {%
@ -387,6 +388,8 @@
% For grid placement from \strut's in \FancyVerbFormatLine
\lineskip\z@skip
% Breaks at punctuation characters . , ; ? ! and / need catcode=\active
% and the active comma should not be overwritten by \@noligs
\let\verbatim@nolig@list \sphinx@verbatim@nolig@list
\OriginalVerbatim[#1,codes*=\sphinxbreaksatpunct]%
}
\renewcommand{\endVerbatim}{%