Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tools/superfences_formaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
from io import StringIO
from collections import OrderedDict
from markdown.util import code_escape


def yaml_load(stream, loader=yaml.Loader):
Expand Down Expand Up @@ -169,7 +170,8 @@ def py_render(src="", language="", class_name=None, options=None, md="", **kwarg
elif target == 'stdout':
result_options['title'] = 'Text Written to STDOUT'
elif target is not None:
result_options['title'] = f'Value of `{target}`'
# Store title in stash to avoid it being escaped by Pygments.
result_options['title'] = md.htmlStash.store(f'Value of <code>{code_escape(target)}</code>')

output = md.preprocessors['fenced_code_block'].highlight(result, output_lang, result_options, md, **kwargs)
return f'{source}\n<div class="result">{output}</div>'
Expand Down
Loading