##// END OF EJS Templates
Only allow '>>>' prompt without space afterwards if line is blank...
Thomas Kluyver -
Show More
@@ -453,8 +453,8 b' def _strip_prompts(prompt_re, initial_re=None):'
453 def classic_prompt():
453 def classic_prompt():
454 """Strip the >>>/... prompts of the Python interactive shell."""
454 """Strip the >>>/... prompts of the Python interactive shell."""
455 # FIXME: non-capturing version (?:...) usable?
455 # FIXME: non-capturing version (?:...) usable?
456 prompt_re = re.compile(r'^(>>> ?|\.\.\. ?)')
456 prompt_re = re.compile(r'^(>>>|\.\.\.)( |$)')
457 initial_re = re.compile(r'^(>>> ?)')
457 initial_re = re.compile(r'^>>>( |$)')
458 return _strip_prompts(prompt_re, initial_re)
458 return _strip_prompts(prompt_re, initial_re)
459
459
460 @CoroutineInputTransformer.wrap
460 @CoroutineInputTransformer.wrap
@@ -455,9 +455,9 b' class IPythonInputTestCase(InputSplitterTestCase):'
455 isp = self.isp
455 isp = self.isp
456 for raw, name, line, cell in [
456 for raw, name, line, cell in [
457 ("%%cellm a\nIn[1]:", u'cellm', u'a', u'In[1]:'),
457 ("%%cellm a\nIn[1]:", u'cellm', u'a', u'In[1]:'),
458 ("%%cellm \nline\n>>>hi", u'cellm', u'', u'line\n>>>hi'),
458 ("%%cellm \nline\n>>> hi", u'cellm', u'', u'line\n>>> hi'),
459 (">>>%%cellm \nline\n>>>hi", u'cellm', u'', u'line\nhi'),
459 (">>> %%cellm \nline\n>>> hi", u'cellm', u'', u'line\nhi'),
460 ("%%cellm \n>>>hi", u'cellm', u'', u'hi'),
460 ("%%cellm \n>>> hi", u'cellm', u'', u'hi'),
461 ("%%cellm \nline1\nline2", u'cellm', u'', u'line1\nline2'),
461 ("%%cellm \nline1\nline2", u'cellm', u'', u'line1\nline2'),
462 ("%%cellm \nline1\\\\\nline2", u'cellm', u'', u'line1\\\\\nline2'),
462 ("%%cellm \nline1\\\\\nline2", u'cellm', u'', u'line1\\\\\nline2'),
463 ]:
463 ]:
General Comments 0
You need to be logged in to leave comments. Login now