diff options
author | Joshua Wong <[email protected]> | 2020-01-18 14:33:15 +0800 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-01-18 11:24:10 +0100 |
commit | 21ca2e9ce4255bfad2bb0576aff087a240acf70a (patch) | |
tree | 42a3c6d5380019c52512743c7f02051e217a165d /parser/pageparser/pageparser_shortcode_test.go | |
parent | 3efa1d81219a6e7b41c9676e9cab446741f69055 (diff) | |
download | hugo-21ca2e9ce4255bfad2bb0576aff087a240acf70a.tar.gz hugo-21ca2e9ce4255bfad2bb0576aff087a240acf70a.zip |
Add support for newline characters in raw string shortcode
Diffstat (limited to 'parser/pageparser/pageparser_shortcode_test.go')
-rw-r--r-- | parser/pageparser/pageparser_shortcode_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/parser/pageparser/pageparser_shortcode_test.go b/parser/pageparser/pageparser_shortcode_test.go index 8d1ebda2f..b8bf5f727 100644 --- a/parser/pageparser/pageparser_shortcode_test.go +++ b/parser/pageparser/pageparser_shortcode_test.go @@ -89,6 +89,12 @@ var shortCodeLexerTests = []lexerTest{ tstLeftNoMD, tstSC1, nti(tScParam, "-ziL-.%QigdO-4"), tstRightNoMD, tstEOF}}, {"raw string", `{{< sc1` + "`" + "Hello World" + "`" + ` >}}`, []Item{ tstLeftNoMD, tstSC1, nti(tScParam, "Hello World"), tstRightNoMD, tstEOF}}, + {"raw string with newline", `{{< sc1` + "`" + `Hello + World` + "`" + ` >}}`, []Item{ + tstLeftNoMD, tstSC1, nti(tScParam, `Hello + World`), tstRightNoMD, tstEOF}}, + {"raw string with escape character", `{{< sc1` + "`" + `Hello \b World` + "`" + ` >}}`, []Item{ + tstLeftNoMD, tstSC1, nti(tScParam, `Hello \b World`), tstRightNoMD, tstEOF}}, {"two params", `{{< sc1 param1 param2 >}}`, []Item{ tstLeftNoMD, tstSC1, tstParam1, tstParam2, tstRightNoMD, tstEOF}}, // issue #934 |