Switched from text/template to html/template
This commit is contained in:
parent
f34db50464
commit
eb45ec612e
BIN
client/client
BIN
client/client
Binary file not shown.
|
@ -9,6 +9,7 @@ DeleteAll()
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"html/template"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -135,7 +136,7 @@ func GetTasks(username, status, category string) (types.Context, error) {
|
|||
task.CompletedMsg = strconv.Itoa(taskCompleted) + " complete out of " + strconv.Itoa(totalTasks)
|
||||
}
|
||||
|
||||
task.Content = string(md.Markdown([]byte(task.Content)))
|
||||
task.ContentHTML = template.HTML(md.Markdown([]byte(task.Content)))
|
||||
// TaskContent = strings.Replace(TaskContent, "\n", "<br>", -1)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
|
||||
|
||||
<span class="noteContent">
|
||||
{{$value.Content}}
|
||||
{{$value.ContentHTML}}
|
||||
{{$value.CompletedMsg}}
|
||||
<div class="commentslist">
|
||||
{{range $value.Comments}}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package types
|
||||
|
||||
import "html/template"
|
||||
|
||||
/*
|
||||
Package types is used to store the context struct which
|
||||
is passed while templates are executed.
|
||||
|
@ -9,6 +11,7 @@ type Task struct {
|
|||
Id int `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
ContentHTML template.HTML `json:"content_html"`
|
||||
Created string `json:"created"`
|
||||
Priority string `json:"priority"`
|
||||
Category string `json:"category"`
|
||||
|
|
|
@ -5,13 +5,13 @@ Holds the non insert/update/delete related view handlers
|
|||
*/
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/thewhitetulip/Tasks/db"
|
||||
"github.com/thewhitetulip/Tasks/sessions"
|
||||
|
|
|
@ -3,8 +3,8 @@ package views
|
|||
/*Holds the fetch related view handlers*/
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/thewhitetulip/Tasks/db"
|
||||
|
|
Loading…
Reference in New Issue