File: docutils-013.patch

package info (click to toggle)
ruby-github-markup 1.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 336 kB
  • ctags: 118
  • sloc: ruby: 373; python: 113; sh: 21; makefile: 15
file content (33 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From e97e4769e1e43fa27193596e968d529537c94f6c Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Thu, 22 Dec 2016 11:06:39 +0300
Subject: [PATCH] Make rest2html work with docutils 0.13

In that docutils version, HTMLTranslator.visit_image no longer appends
empty string to self.context, so trying to pop() from there raises an
IndexError.

Instead of the hard-coded pop call, call the overridden method, which will
call pop() on docutils 0.12 and will do nothing on docutils 0.13.

Fixes #971.

Also, fix the comment indentation.
---
 lib/github/commands/rest2html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/lib/github/commands/rest2html
+++ b/lib/github/commands/rest2html
@@ -142,9 +142,9 @@
 
             # toss off `object` tag
             self.body.pop()
-        # add on `img` with attributes
+            # add on `img` with attributes
             self.body.append(self.starttag(node, 'img', **atts))
-        self.body.append(self.context.pop())
+        HTMLTranslator.depart_image(self, node)
 
 
 def kbd(name, rawtext, text, lineno, inliner, options=None, content=None):