Commits

André Felipe Dias  committed 69af9cb

rst2html5: code block should not inseert highlight style

  • Participants
  • Parent commits c0802a9

Comments (0)

Files changed (3)

File rst2html5.py

         if 'code' in node['classes']:
             code = node['classes'].index('code')
             node['classes'].pop(code)
-            highlight = 'highlight' + ''.join(' language-' + l for l in node['classes'])
-            code = tag.code(class_=highlight)
+            code = tag.code(class_=' '.join(node['classes']))
             self.context.commit_elem(code, indent=False)
             del node['classes']
         self.default_departure(node)
 
 setup(
     name='rst2html5',
-    version='0.9',
+    version='0.10',
     author='André Felipe Dias',
     author_email='andref.dias@gmailself.com',
     url='https://bitbucket.org/andre_felipe_dias/rst2html5',

File tests/cases.py

 
 
 parsed_literal_as_code_block = {
-    'rst': """.. class:: code python
+    'rst': """.. class:: code language-python
 
 .. parsed-literal::
 
 
 """,
     'out': """
-    <pre><code class="highlight language-python">def extract_variables(module):
+    <pre><code class="language-python">def extract_variables(module):
     '''
     Extract variables of a test data module.
     Variables should be a dict().
             if not v.startswith('__') and isinstance(getattr(module, v), dict))
 """,
     'out': """
-    <pre><code class="highlight language-python"><span class="k">def</span> <span class="nf">extract_variables</span>\
+    <pre><code class="python"><span class="k">def</span> <span class="nf">extract_variables</span>\
 <span class="p">(</span><span class="n">module</span><span class="p">):</span>
     <span class="sd">'''
     Extract variables of a test data module.