[PATCH] fix broken line_offset calculation in code_block_directive

13 views
Skip to first unread message

Masatake YAMATO

unread,
Oct 22, 2013, 9:59:27 AM10/22/13
to rst2pdf...@googlegroups.com
line_offset must be calculated before updating content.

Signed-off-by: Masatake YAMATO<yam...@redhat.com>

Index: pygments_code_block_directive.py
===================================================================
--- pygments_code_block_directive.py    (revision 2633)
+++ pygments_code_block_directive.py    (working copy)
@@ -178,8 +178,8 @@
                     after_index -= 1
                 # patch mmueller end

+                line_offset = len(content[:after_index].splitlines())
                 content = content[after_index:]
-                line_offset = len(content[:after_index].splitlines())

             after_text = options.get('start-after', None)
             if after_text:
Reply all
Reply to author
Forward
0 new messages