v0.13 hard wrapped shortcodes

Just updated to v0.13 and Hugo now complains about the way I format my shortcodes (“unterminated quoted string in shortcode parameter-argument”). I like to be able to write in Vim and Vim is so much easier to deal with when instead of this:

{{% figure src=“Lorem ipsum dolor sit amet, consectetur adipiscing elit.” alt=“Lorem ipsum dolor sit amet, consectetur adipiscing elit.” %}}

You configure it to automatically write this (with a 80-char limit):

{{% figure src="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
alt=“Lorem ipsum dolor sit amet, consectetur adipiscing elit.” %}}

Hugo still understands what to do, as it’s done in v0.12, but on a big enough site the list of errors is confusing and I’d rather not see it. Anyone agree?

The errors are real errors and should be corrected if you want correct output.

@bjornerik, the error is the new-line in the shortcode? So the error message is confusing?

Yes, the error message could be more clear, but it’s the newline inside the parameter quotes.

I didn’t mean to say the message is confusing, I actually understood pretty quickly what was going on. What’s confusing is seeing it pop up six times in my start log and not seeing any difference whether I leave the newlines or not. Steve himself is a Vim user and leaves newlines in his content, that’s just the natural way to do it with *nix tools. I wish Hugo would understand this.

If you’re not seeing the difference, then you are doing something else wrong (seeing stale content?).

If you think this is wrong / too strict parsing, file an issue on GitHub, I cannot think of any issue with allowing newlines inside params, but I didn’t think about it when I implemented it (other parsers have the same restriction).

I’m on Linux, and a soft wrapped editor is my prefered choice.

It actually works, but not all the time. Just saw that. I will fill an issue, thanks. I think this can put hard wrap writers in a difficult situation, although I agree that it doesn’t look like they’ve been complaining much so far.