Skip to content

Commit afaac84

Browse files
committed
Fix extractsagecode env blocks for new pyparsing + ignore comments
1 parent 5a855de commit afaac84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts.dtx

+2-1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ class SageCodeExtractor():
495495
sunpause.setParseAction(self.unpause)
496496
497497
doit = smacro | splot | senv | spause | sunpause
498+
doit.ignore('%' + restOfLine)
498499
499500
str = ''.join(open(texfn, 'r').readlines())
500501
self.result = ''
@@ -514,7 +515,7 @@ class SageCodeExtractor():
514515
def envout(self, s, l, t):
515516
self.result += '# %s environment from line %s:' % (t.env,
516517
lineno(l, s))
517-
self.result += t.code[0] + '\n'
518+
self.result += ''.join(t.code) + '\n'
518519
519520
def pause(self, s, l, t):
520521
self.result += ('# SageTeX (probably) paused on input line %s.\n\n' %

0 commit comments

Comments
 (0)