mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Case insensitive translation of the 'more' tag when importing from Jekyll
This commit is contained in:
parent
c2ffdfab63
commit
9dfb9c1445
2 changed files with 3 additions and 1 deletions
|
@ -518,7 +518,7 @@ func convertJekyllContent(m interface{}, content string) string {
|
||||||
re *regexp.Regexp
|
re *regexp.Regexp
|
||||||
replace string
|
replace string
|
||||||
}{
|
}{
|
||||||
{regexp.MustCompile("<!-- more -->"), "<!--more-->"},
|
{regexp.MustCompile("(?i)<!-- more -->"), "<!--more-->"},
|
||||||
{regexp.MustCompile(`\{%\s*raw\s*%\}\s*(.*?)\s*\{%\s*endraw\s*%\}`), "$1"},
|
{regexp.MustCompile(`\{%\s*raw\s*%\}\s*(.*?)\s*\{%\s*endraw\s*%\}`), "$1"},
|
||||||
{regexp.MustCompile(`{%\s*highlight\s*(.*?)\s*%}`), "{{< highlight $1 >}}"},
|
{regexp.MustCompile(`{%\s*highlight\s*(.*?)\s*%}`), "{{< highlight $1 >}}"},
|
||||||
{regexp.MustCompile(`{%\s*endhighlight\s*%}`), "{{< / highlight >}}"},
|
{regexp.MustCompile(`{%\s*endhighlight\s*%}`), "{{< / highlight >}}"},
|
||||||
|
|
|
@ -88,6 +88,8 @@ func TestConvertJekyllContent(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{map[interface{}]interface{}{},
|
{map[interface{}]interface{}{},
|
||||||
`Test content\n<!-- more -->\npart2 content`, `Test content\n<!--more-->\npart2 content`},
|
`Test content\n<!-- more -->\npart2 content`, `Test content\n<!--more-->\npart2 content`},
|
||||||
|
{map[interface{}]interface{}{},
|
||||||
|
`Test content\n<!-- More -->\npart2 content`, `Test content\n<!--more-->\npart2 content`},
|
||||||
{map[interface{}]interface{}{"excerpt_separator": "<!--sep-->"},
|
{map[interface{}]interface{}{"excerpt_separator": "<!--sep-->"},
|
||||||
`Test content\n<!--sep-->\npart2 content`, `Test content\n<!--more-->\npart2 content`},
|
`Test content\n<!--sep-->\npart2 content`, `Test content\n<!--more-->\npart2 content`},
|
||||||
{map[interface{}]interface{}{}, "{% raw %}text{% endraw %}", "text"},
|
{map[interface{}]interface{}{}, "{% raw %}text{% endraw %}", "text"},
|
||||||
|
|
Loading…
Reference in a new issue