helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 365 forks source link

Not splitting string by line breaks '\n' #396

Open kAleksei opened 2 years ago

kAleksei commented 2 years ago

I use this extension in Xplat Release Notes VSIX package. So faced with this issue while writing release notes template. It uses:

"handlebars": "^4.7.7",
"handlebars-helpers": "^0.10.0"

While trying to execute split (and log the result) faced with the issue, when it's not splitting the string by \n character

{{log (split this.description "\n")}}

Log messages:

[ "Select only one item in the collection for appropriate semantic versioning:\n- [X] Major\n- [ ] Feature\n- [ ] Hotfix\n\n###Breaking changes\n - Some changes" ]
[ "# Breaking changes\n- Some changes added\n# Fixes\n- Something fixed" ]

Originally posted by @kAleksei in https://github.com/helpers/handlebars-helpers/issues/300#issuecomment-952785823

zkent commented 1 year ago

Has anyone come up with a solution for this? I am trying to use split for strings that have a double newline such as \n\n. I can't figure out how to split them. Where is the split helper coming from? I haven't seen it in the code.

(sorry for posting this in discussion also)