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
170 | 170 |
end
|
171 | 171 |
pretty_code (code,fence)
|
172 | 172 |
line = getline() -- skip fence
|
|
173 |
if not line then break end
|
173 | 174 |
end
|
174 | 175 |
indent, line = indent_line(line)
|
175 | 176 |
if indent >= 4 then -- indented code block
|
49 | 49 |
io.stderr:write(fname..':'..tok:lineno()+initial_lineno..': '..msg,'\n')
|
50 | 50 |
end
|
51 | 51 |
}
|
|
52 |
local last_t, last_val
|
52 | 53 |
local t,val = tok()
|
53 | 54 |
if not t then return nil,"empty file" end
|
54 | 55 |
while t do
|
|
70 | 71 |
else
|
71 | 72 |
res:append(val)
|
72 | 73 |
end
|
|
74 |
last_t, last_val = t,val
|
73 | 75 |
t,val = tok()
|
|
76 |
end
|
|
77 |
if last_t == 'comment' then
|
|
78 |
res[#res] = span('comment',last_val:gsub('\r*\n$',''))
|
74 | 79 |
end
|
75 | 80 |
local last = res[#res]
|
76 | 81 |
if last:match '\n$' then
|