1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: relative_short(); fmt: handle $vweb.html()

This commit is contained in:
Alexander Medvednikov
2020-06-11 20:26:46 +02:00
parent 3bf9b28773
commit 72fdb09e46
4 changed files with 42 additions and 12 deletions

View File

@@ -28,15 +28,15 @@ enum State {
pub fn compile_template(html_, fn_name string) string {
// lines := os.read_lines(path)
mut html := html_
mut html := html_.trim_space()
mut header := ''
if os.exists('templates/header.html') && html.contains('@header') {
h := os.read_file('templates/header.html') or {
panic('reading file templates/header.html failed')
}
header = h.replace("\'", '"')
html = header + html
}
if os.exists('templates/header.html') && html.contains('@header') {
h := os.read_file('templates/header.html') or {
panic('reading file templates/header.html failed')
}
header = h.trim_space().replace("\'", '"')
html = header + html
}
mut lines := html.split_into_lines()
mut s := strings.new_builder(1000)