Skip to content

Commit 5905bd8

Browse files
committed
Fix extractsagecode env blocks for new pyparsing + ignore comments
1 parent fc62c3c commit 5905bd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts.dtx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ class SageCodeExtractor():
498498
sunpause.setParseAction(self.unpause)
499499
500500
doit = smacro | splot | senv | spause | sunpause
501+
doit.ignore('%' + restOfLine)
501502
502503
str = ''.join(open(texfn, 'r').readlines())
503504
self.result = ''
@@ -517,7 +518,7 @@ class SageCodeExtractor():
517518
def envout(self, s, l, t):
518519
self.result += '# %s environment from line %s:' % (t.env,
519520
lineno(l, s))
520-
self.result += t.code[0] + '\n'
521+
self.result += ''.join(t.code) + '\n'
521522
522523
def pause(self, s, l, t):
523524
self.result += ('# SageTeX (probably) paused on input line %s.\n\n' %

0 commit comments

Comments
 (0)