Skip to content

Commit

Permalink
Merge pull request #1023 from amniskin/patch-1
Browse files Browse the repository at this point in the history
dedenting html in ExtractOutputPreprocessor
  • Loading branch information
MSeal authored May 14, 2019
2 parents 8af6aac + 036b9cd commit 06f3a90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nbconvert/preprocessors/extractoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

from textwrap import dedent
from binascii import a2b_base64
import sys
import os
Expand Down Expand Up @@ -82,6 +83,8 @@ def preprocess_cell(self, cell, resources, cell_index):
for index, out in enumerate(cell.get('outputs', [])):
if out.output_type not in {'display_data', 'execute_result'}:
continue
if 'text/html' in out.data:
out['data']['text/html'] = dedent(out['data']['text/html'])
#Get the output in data formats that the template needs extracted
for mime_type in self.extract_output_types:
if mime_type in out.data:
Expand Down

0 comments on commit 06f3a90

Please sign in to comment.