Skip to content

Commit

Permalink
vdoc: fix multiline js string generation in search_index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Jun 2, 2024
1 parent 8504bea commit 4884396
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/tools/vdoc/html.v
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ fn (vd VDoc) render_search_index(out Output) {
for i, title in vd.search_module_index {
data := vd.search_module_data[i]
js_search_index.write_string('"${title}",\n')
js_search_data.write_string('["${data.description}","${data.link}"],\n')
description := data.description.replace('\n', '').replace('\r', '') // fix multiline js string bug
js_search_data.write_string('["${description}","${data.link}"],\n')
}
js_search_index.writeln('];\n')
js_search_index.write_string('var searchIndex = [\n')
Expand Down
1 change: 1 addition & 0 deletions vlib/builtin/builtin.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ pub fn free(ptr voidptr) {
unsafe { C.GC_FREE(ptr) }
}
} $else {
//println('c.free')
C.free(ptr)
}
}
Expand Down

0 comments on commit 4884396

Please sign in to comment.