Skip to content

Commit 19eee80

Browse files
author
Matthias Koeppe
committed
src/bin/sage-fixdoctests: Append block tag line to previous line instead of prepending to current line
1 parent bf270c7 commit 19eee80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/sage-fixdoctests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def process_block(block, src_in_lines, file_optional_tags):
143143

144144
if m := re.search(r"using.*block-scoped tag.*'(sage: .*)'.*to avoid repeating the tag", block):
145145
indent = (len(src_in_lines[first_line_num - 1]) - len(src_in_lines[first_line_num - 1].lstrip()))
146-
src_in_lines[line_num - 1] = ' ' * indent + m.group(1) + '\n' + src_in_lines[line_num - 1]
146+
src_in_lines[line_num - 2] += '\n' + ' ' * indent + m.group(1)
147147

148148
if m := re.search(r"updating.*block-scoped tag.*'sage: (.*)'.*to avoid repeating the tag", block):
149149
src_in_lines[first_line_num - 1] = update_optional_tags(src_in_lines[first_line_num - 1],

0 commit comments

Comments
 (0)