fusion-afx
fusion-afx copied to clipboard
"keep whitespace" mode
As documented AFX strips whitespaces and newlines and this makes a lot of sense usually.
But sometimes it can be useful or even required to keep the whitespaces, for example when using AFX for email templates, code generators or code snippets.
For those it would be nice to have some kind of "keep whitespace" mode, for example:
emailTemplate = afxkws`
Hello {props.name},
foo bar baz
`
It seems as it's just this one line that removes the whitespaces: https://github.com/neos/fusion-afx/blob/master/Classes/Service/AfxService.php#L182
So it should be fairly easy to implement this
The linked issue neos/neos-development-collection#3331 has another example for "regular website content", this is not limited to "exotic" code or mail rendering…
It seems as it's just this one line that removes the whitespaces: https://github.com/neos/fusion-afx/blob/master/Classes/Service/AfxService.php#L182
@bwaidelich Is that line still the correct one? The link points to master
, not a specific revision, and the code has changed since August 2018…
https://github.com/neos/fusion-afx/blob/3774d2fd70769cc3448255d3dd52ff0b663fe811/Classes/Service/AfxService.php#L327 seems to be the correct location
seems to be the correct location
This is the right one IIRC: https://github.com/neos/fusion-afx/blob/3774d2fd70769cc3448255d3dd52ff0b663fe811/Classes/Service/AfxService.php#L306