-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim all whitespace in elements written to hugo_stats.json #7958
Comments
I'm looking to contribute to Hugo. This will be my first issue in a big project. Let me know if this is simple enough for me to make as a PR. Also, please guide me with more context if any. Edit: As far as I understand, the whitespaces like \n \t should be trimmed from hugo_stats.json Edit2: Would using |
I don't know what that does, but I was thinking more inline of doing https://github.com/gohugoio/hugo/blob/master/publisher/htmlElementsCollector.go#L233 |
My skills in Go language are pretty poor at the moment, I let you fix that one 😅 My 2 cents : trimming the spaces while parsing HTML elements, as suggested by @bep, is probably more efficient than calling a function like |
https://github.com/gohugoio/hugo/blob/master/publisher/htmlElementsCollector.go#L234 has the |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
I have a markdown content file with a form element declared on several lines :
I run
hugo server -e production
EXPECTED: a "form" tag is added in
hugo_stats.json
tags listACTUAL: a "form\n" tag is added in
hugo_stats.json
tags listNote: The issue does not happen if the form is declared in one line :
The text was updated successfully, but these errors were encountered: