Skip to content

Commit

Permalink
use <code> not <tt> for rst inline literals
Browse files Browse the repository at this point in the history
  • Loading branch information
moskvax committed Sep 18, 2014
1 parent 258a31e commit b1e4fb6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/github/commands/rest2html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ class GitHubHTMLTranslator(HTMLTranslator):
else:
self.body.append(self.starttag(node, 'pre'))

# always wrap two-backtick rst inline literals in <code>, not <tt>
# this also avoids the generation of superfluous <span> tags
def visit_literal(self, node):
self.body.append(self.starttag(node, 'code', suffix=''))

def depart_literal(self, node):
self.body.append('</code>')

def visit_table(self, node):
classes = ' '.join(['docutils', self.settings.table_style]).strip()
self.body.append(
Expand Down

0 comments on commit b1e4fb6

Please sign in to comment.