Fix input fields getting escaped twice

This commit is contained in:
Zed 2019-11-26 05:45:05 +01:00
parent 2977972274
commit fba7ed2a19
1 changed files with 4 additions and 5 deletions

View File

@ -62,15 +62,14 @@ proc genCheckbox*(pref, label: string; state: bool): VNode =
span(class="checkbox")
proc genInput*(pref, label, state, placeholder: string; class=""): VNode =
let s = xmltree.escape(state)
let p = xmltree.escape(placeholder)
let p = placeholder
buildHtml(tdiv(class=("pref-group pref-input " & class))):
if label.len > 0:
label(`for`=pref): text label
if s.len == 0:
input(name=pref, `type`="text", placeholder=p, value=s, autofocus="")
if state.len == 0:
input(name=pref, `type`="text", placeholder=p, value=state, autofocus="")
else:
input(name=pref, `type`="text", placeholder=p, value=s)
input(name=pref, `type`="text", placeholder=p, value=state)
proc genSelect*(pref, label, state: string; options: seq[string]): VNode =
buildHtml(tdiv(class="pref-group pref-input")):