Skip to content

Commit

Permalink
InlineHighlite should work without Pygments too
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Jan 27, 2017
1 parent 650aaac commit 478b410
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pymdownx/inlinehilite.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,22 @@
'''


class InlineCodeHtmlFormatter(HtmlFormatter):
"""Format the code blocks."""
if pygments:
class InlineCodeHtmlFormatter(HtmlFormatter):
"""Format the code blocks."""

def wrap(self, source, outfile):
"""Overload wrap."""
def wrap(self, source, outfile):
"""Overload wrap."""

return self._wrap_code(source)
return self._wrap_code(source)

def _wrap_code(self, source):
"""Return source, but do not wrap in inline <code> block."""
def _wrap_code(self, source):
"""Return source, but do not wrap in inline <code> block."""

yield 0, ''
for i, t in source:
yield i, t.strip()
yield 0, ''
yield 0, ''
for i, t in source:
yield i, t.strip()
yield 0, ''


class InlineHilitePattern(Pattern):
Expand Down

0 comments on commit 478b410

Please sign in to comment.