authorgravatar for pfg@pfg.pwpfg <pfg@pfg.pw> 2021-10-03 16:32:30-04:00
committergravatar for pfg@pfg.pwpfg <pfg@pfg.pw> 2021-10-03 16:32:30-04:00
log5d8f8cdca51c3fdcfe6657adcd5b7d2872571940
tree24a2766d84e93de5cd6d6f50e5acae9c9c503d43
parenta92b14426027a893a6e03e42383693a637e2c1c0

fix assuming multiline string tokens end with '\n'


1 files changed, 9 insertions(+), 3 deletions(-)

doc/docgen.zig+9-3
......@@ -990,9 +990,15 @@ fn tokenizeAndPrintRaw(
990990 },
991991
992992 .multiline_string_literal_line => {
993 try out.writeAll("<span class=\"tok-str\">");
994 try writeEscaped(out, src[token.loc.start .. token.loc.end - 1]);
995 try out.writeAll("</span>" ++ end_line ++ "\n" ++ start_line);
993 if (src[token.loc.end - 1] == '\n') {
994 try out.writeAll("<span class=\"tok-str\">");
995 try writeEscaped(out, src[token.loc.start .. token.loc.end - 1]);
996 try out.writeAll("</span>" ++ end_line ++ "\n" ++ start_line);
997 } else {
998 try out.writeAll("<span class=\"tok-str\">");
999 try writeEscaped(out, src[token.loc.start..token.loc.end]);
1000 try out.writeAll("</span>");
1001 }
9961002 },
9971003
9981004 .builtin => {