##// END OF EJS Templates
Include empty lines condition in PromptStipper and cell_magic.
Tony Fast -
Show More
@@ -61,6 +61,8 b' class PromptStripper:'
61 61 return [self.prompt_re.sub('', l, count=1) for l in lines]
62 62
63 63 def __call__(self, lines):
64 if not lines:
65 return lines
64 66 if self.initial_re.match(lines[0]) or \
65 67 (len(lines) > 1 and self.prompt_re.match(lines[1])):
66 68 return self._strip(lines)
@@ -74,7 +76,7 b' classic_prompt = PromptStripper('
74 76 ipython_prompt = PromptStripper(re.compile(r'^(In \[\d+\]: |\s*\.{3,}: ?)'))
75 77
76 78 def cell_magic(lines):
77 if not lines[0].startswith('%%'):
79 if not lines or not lines[0].startswith('%%'):
78 80 return lines
79 81 if re.match('%%\w+\?', lines[0]):
80 82 # This case will be handled by help_end
General Comments 0
You need to be logged in to leave comments. Login now