hugo/helpers
Abdullah Diab 481924b34d helpers: Fix broken TaskList in Markdown
As per the referenced issue, if the task list in Markdown has
nothing before it, it will be rendered wrongly:

```
---
title: "My First Post"
date: 2017-07-29T20:21:57+02:00
draft: true
---

* [ ] TaskList

```

is rendered as:

```
<ul> class="task-list"
<li><input type="checkbox" disabled class="task-list-item"> TaskList</li>
</ul>
```

The problem lies in the `List` function of `HugoHTMLRenderer`, it had
a hardocded index of `4` for the first `>` of the list, it is used to
insert the class into the text before the closing bracket, but that
hardcoded index is only right when there is a newline before the
opening bracket, which is the case when there is anything in the
document before the task list, but if there is nothing, then there is
no newline, and the correct index of the first `>` will be `3`.

To fix that we're changing the hardcoded index to be dynamic by using
`bytes.Index` to find it properly. We're also adding a test case to
make sure this is tested against.

Fixes #3710
2017-08-02 00:33:37 +02:00
..
baseURL.go helpers, output: Fix spelling 2017-03-28 01:19:46 +02:00
baseURL_test.go all: Propagate baseURL error to the callers 2017-03-27 15:43:56 +02:00
content.go helpers: Add support for French Guillemets 2017-07-29 10:10:40 +02:00
content_renderer.go helpers: Fix broken TaskList in Markdown 2017-08-02 00:33:37 +02:00
content_renderer_test.go helpers: Fix broken TaskList in Markdown 2017-08-02 00:33:37 +02:00
content_test.go helpers: Add support for French Guillemets 2017-07-29 10:10:40 +02:00
emoji.go helpers: Use iterate operator by int in Emojify 2016-11-23 09:13:00 +01:00
emoji_test.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
general.go Make the title case style guide configurable 2017-07-31 22:16:46 +02:00
general_test.go Make the title case style guide configurable 2017-07-31 22:16:46 +02:00
hugo.go Bump versions to 0.26-DEV 2017-07-10 09:16:02 +02:00
hugo_test.go releaser: Replace the magic version handling 2017-07-05 14:27:43 +02:00
language.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
language_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
path.go Support non-md files as archetype files 2017-06-20 13:41:48 +02:00
path_test.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
pathspec.go commands, create: Add .Site to the archetype templates 2017-06-19 10:47:00 +02:00
pathspec_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
pygments.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
pygments_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
testhelpers_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
url.go output: Rename HTMLType etc. to HTMLFormat 2017-03-27 15:43:56 +02:00
url_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00