hello everybody, i’ve downside to view html format inside go template.
i’ve providers that return values, i insert
to one in all them like this :
func ToProduct(product ProductModel.Product) ProductResponse {
return ProductResponse{
Code: product.Code,
Title: product.Title,
Description: product.Description,
Qty: product.Qty,
Value: product.Value,
Price1: product.Price1,
ShortNotes: product.ShortNotes,
Notes: strings.Substitute(product.Notes, ",", "<br>", -1),
Picture: "/property/img/merchandise/" + product.Code + ".jpg",
DivName: product.DivName,
}
}
in html template, i put this
however the outcome
appear as if unique textual content not new line
Invalid JSON!
Error: Parse error on line 1:
ProductResponse{ C
^
Anticipating 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
Just log the json output of the vars