Codebase list lua-ldoc / c9b6483
issue #240 blank line after comment at end of code block. Crash with fenced block at end of document fixed Steve Donovan 7 years ago
2 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
170170 end
171171 pretty_code (code,fence)
172172 line = getline() -- skip fence
173 if not line then break end
173174 end
174175 indent, line = indent_line(line)
175176 if indent >= 4 then -- indented code block
4949 io.stderr:write(fname..':'..tok:lineno()+initial_lineno..': '..msg,'\n')
5050 end
5151 }
52 local last_t, last_val
5253 local t,val = tok()
5354 if not t then return nil,"empty file" end
5455 while t do
7071 else
7172 res:append(val)
7273 end
74 last_t, last_val = t,val
7375 t,val = tok()
76 end
77 if last_t == 'comment' then
78 res[#res] = span('comment',last_val:gsub('\r*\n$',''))
7479 end
7580 local last = res[#res]
7681 if last:match '\n$' then