diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html
index ca9f26ff..63ecc0ed 100755
--- a/lib/github/commands/rest2html
+++ b/lib/github/commands/rest2html
@@ -66,12 +66,15 @@ class GitHubHTMLTranslator(HTMLTranslator):
# see also: http://bit.ly/1exfq2h (warning! sourceforge link.)
def depart_document(self, node):
HTMLTranslator.depart_document(self, node)
- self.html_body.pop(0)
- self.html_body.pop()
+ self.html_body.pop(0) # pop the starting
off
+ self.html_body.pop() # pop the ending
off
# technique for visiting sections, without generating additional divs
# see also: http://bit.ly/NHtyRx
+ # the a is to support ::contents with ::sectnums: http://git.io/N1yC
def visit_section(self, node):
+ id_attribute = node.attributes['ids'][0]
+ self.body.append('\n' % id_attribute)
self.section_level += 1
def depart_section(self, node):
diff --git a/test/markups/README.rst.html b/test/markups/README.rst.html
index a074e8d5..77b79b98 100644
--- a/test/markups/README.rst.html
+++ b/test/markups/README.rst.html
@@ -8,6 +8,7 @@ Subtitle
Field list
+
- Blah blah
code
blah
@@ -46,6 +47,7 @@
+
diff --git a/test/markups/README.rst.txt.html b/test/markups/README.rst.txt.html
index d2e61dc6..6d5d0675 100644
--- a/test/markups/README.rst.txt.html
+++ b/test/markups/README.rst.txt.html
@@ -1,5 +1,6 @@
Header 1
Example text.
+
Header 2
- Blah blah
code
blah
diff --git a/test/markups/README.toc.rst b/test/markups/README.toc.rst
new file mode 100644
index 00000000..a86b88a5
--- /dev/null
+++ b/test/markups/README.toc.rst
@@ -0,0 +1,30 @@
+.. contents::
+ :backlinks: none
+
+.. sectnum::
+
+Introduction
+============
+
+What is pycparser?
+------------------
+
+**pycparser** is a parser for the C language, written in pure Python. It is a
+module designed to be easily integrated into applications that need to parse
+C source code.
+
+What is it good for?
+--------------------
+
+Anything that needs C code to be parsed. The following are some uses for
+**pycparser**, taken from real user reports:
+
+* C code obfuscator
+* Front-end for various specialized C compilers
+* Static code checker
+* Automatic unit-test discovery
+* Adding specialized extensions to the C language
+
+**pycparser** is unique in the sense that it's written in pure Python - a very
+high level language that's easy to experiment with and tweak. To people familiar
+with Lex and Yacc, **pycparser**'s code will be simple to understand.
diff --git a/test/markups/README.toc.rst.html b/test/markups/README.toc.rst.html
new file mode 100644
index 00000000..4890e99b
--- /dev/null
+++ b/test/markups/README.toc.rst.html
@@ -0,0 +1,32 @@
+
+
+1 Introduction
+
+1.1 What is pycparser?
+pycparser is a parser for the C language, written in pure Python. It is a
+module designed to be easily integrated into applications that need to parse
+C source code.
+
+1.2 What is it good for?
+Anything that needs C code to be parsed. The following are some uses for
+pycparser, taken from real user reports:
+
+- C code obfuscator
+- Front-end for various specialized C compilers
+- Static code checker
+- Automatic unit-test discovery
+- Adding specialized extensions to the C language
+
+pycparser is unique in the sense that it's written in pure Python - a very
+high level language that's easy to experiment with and tweak. To people familiar
+with Lex and Yacc, pycparser's code will be simple to understand.