Skip to content

Commit bda8578

Browse files
committed
Refactor handling of last line to use a case statement
1 parent f2cb8f4 commit bda8578

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/cli2md.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@
8888
end
8989
end
9090

91-
# last line of input was in a table
92-
puts "</table>\n\n<!-- vale on -->\n" if state == STATE_TABLE
93-
94-
# last line of input was in a code block
95-
puts "```" if state == STATE_CODE
91+
# handle when the last line was in a code block or table
92+
case state
93+
when STATE_TABLE
94+
puts "</table>\n\n<!-- vale on -->\n"
95+
when STATE_CODE
96+
puts "```"
97+
end

0 commit comments

Comments
 (0)