Skip to content

Commit fe90a66

Browse files
author
Jürgen Hasch
committed
Remove redundant check
1 parent 80ed43d commit fe90a66

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/jupyter_contrib_nbextensions/nbconvert_support/pre_codefolding.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def preprocess(self, nb, resources):
6969
def preprocess_cell(self, cell, resources, index):
7070
"""
7171
Read cell metadata and remove lines marked as `folded`.
72-
Requires configuration parameter 'NbConvertApp.codefolding = True'
7372
7473
Parameters
7574
----------
@@ -81,11 +80,10 @@ def preprocess_cell(self, cell, resources, index):
8180
index : int
8281
Index of the cell being processed (see base.py)
8382
"""
84-
if self.remove_folded_code:
85-
if hasattr(cell, 'source') and cell.cell_type == 'code':
86-
if hasattr(cell['metadata'], 'code_folding'):
87-
folded = cell['metadata']['code_folding']
88-
if len(folded) > 0:
89-
self.log.debug('Removing folded code in cell')
90-
cell.source = self.fold_cell(cell.source, folded)
83+
if hasattr(cell, 'source') and cell.cell_type == 'code':
84+
if hasattr(cell['metadata'], 'code_folding'):
85+
folded = cell['metadata']['code_folding']
86+
if len(folded) > 0:
87+
self.log.debug('Removing folded code in cell')
88+
cell.source = self.fold_cell(cell.source, folded)
9189
return cell, resources

0 commit comments

Comments
 (0)