Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Feb 9, 2024
1 parent 2d991b0 commit b4c9a39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bolt-pages/bolt/pages/markdown.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mistune
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import html
from pygments.lexers import get_lexer_by_name


class HighlightRenderer(mistune.HTMLRenderer):
Expand All @@ -10,7 +10,7 @@ def block_code(self, code, info=None):
lexer = get_lexer_by_name(info, stripall=True)
formatter = html.HtmlFormatter()
return highlight(code, lexer, formatter)
return '<pre><code>' + mistune.escape(code) + '</code></pre>'
return "<pre><code>" + mistune.escape(code) + "</code></pre>"


def render_markdown(content):
Expand Down
4 changes: 3 additions & 1 deletion bolt-pages/bolt/pages/pages.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import os

import frontmatter
from .markdown import render_markdown

from bolt.templates.jinja import environment
from bolt.utils.functional import cached_property

from .markdown import render_markdown


class Page:
def __init__(self, url_path, relative_path, absolute_path):
Expand Down

0 comments on commit b4c9a39

Please sign in to comment.