##// END OF EJS Templates
Strip vi-mode style prompts too (singleline)...
Blazej Michalik -
Show More
@@ -89,7 +89,28 b' classic_prompt = PromptStripper('
89 initial_re=re.compile(r'^>>>( |$)')
89 initial_re=re.compile(r'^>>>( |$)')
90 )
90 )
91
91
92 ipython_prompt = PromptStripper(re.compile(r'^(In \[\d+\]: |\s*\.{3,}: ?)'))
92 ipython_prompt = PromptStripper(re.compile(
93 r'''
94 ^( # Match from the beginning of a line, either:
95
96 # 1. First-line prompt:
97 ((\[nav\]|\[ins\])?\ )? # Vi editing mode prompt, if it's there
98 In\ # The 'In' of the prompt, with a space
99 \[\d+\]: # Command index, as displayed in the prompt
100 \ # With a mandatory trailing space
101
102 | # ... or ...
103
104 # 2. The three dots of the multiline prompt
105 \s* # All leading whitespace characters
106 \.{3,}: # The three (or more) dots
107 \ ? # With an optional trailing space
108
109 )
110 ''',
111 re.VERBOSE
112 ))
113
93
114
94 def cell_magic(lines):
115 def cell_magic(lines):
95 if not lines or not lines[0].startswith('%%'):
116 if not lines or not lines[0].startswith('%%'):
General Comments 0
You need to be logged in to leave comments. Login now