From a1fdd16073c8ed96c0e742462f375b64270dd771 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 31 Mar 2016 11:03:00 -0400 Subject: [PATCH] Fixed error with links in lists --- routes.go | 9 +++++++++ templates/list.tmpl | 8 ++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/routes.go b/routes.go index cb4320b..308c675 100644 --- a/routes.go +++ b/routes.go @@ -459,6 +459,15 @@ func renderList(c *gin.Context, title string) { pClean.AllowDataURIImages() text := pClean.SanitizeBytes([]byte(p.CurrentText)) listItems, _ := reorderList(string(text)) + for i := range listItems { + newHTML := strings.Replace(string(listItems[i]), "", ""+``, -1) + newHTML = strings.Replace(newHTML, "", "
  • "+``, -1) + newHTML = strings.Replace(newHTML, "
  • ", "
    ", -1) + newHTML = strings.Replace(newHTML, "
  • "+``, "
  • "+``, -1) + newHTML = strings.Replace(newHTML, "
  • ", "", -1) + listItems[i] = template.HTML([]byte(newHTML)) + } c.HTML(http.StatusOK, "list.tmpl", gin.H{ "Title": title, "WikiName": RuntimeArgs.WikiName, diff --git a/templates/list.tmpl b/templates/list.tmpl index a89e84e..eae054a 100644 --- a/templates/list.tmpl +++ b/templates/list.tmpl @@ -11,6 +11,7 @@ padding: 0; list-style-type: none; } +span { cursor: pointer; } @@ -45,7 +46,7 @@
    @@ -54,9 +55,6 @@ $('.deletable').click(function(event) { event.preventDefault(); var lineNum = $(this).attr('id') - var href = $(this).attr('href') - if (href == "#") { - console.log(lineNum) $.ajax({ url: "/listitem" + '?' + $.param({ "lineNum": lineNum, @@ -67,8 +65,6 @@ window.location.reload(true); } }); - } - }); $(document).keydown(function(e){