Can't use multiline values with shortcode paramaters

Writing some stuff to work with C3.js and working on writing shortcode for just passing raw data for cases that can’t be planned for(non-basic graphing stuff). This requires basically a chunk of json and for sanity purposes spreading it over multiple lines.

{{% chart-generateraw raw="
test

"  %}}

results in

Building sites … ERROR 2018/10/03 02:15:03 posts/graphing.org:22: unterminated quoted string in shortcode parameter-argument: '
'

The shortcode is…

<script>
var chart = c3.generate({
        {{ .Get "raw" }}
});
</script>

You need to pass that as the Inner content.

@VVelox

Did you figure it out? I’m trying to do the same, but I’m too new to Go and Hugo to find the solution.

Thanks.

You need to use “raw text litterals” (I think that’s what they’re named …, see the back ticks below)

{{% chart-generateraw raw=`
test

`  %}}
1 Like