fusion-afx icon indicating copy to clipboard operation
fusion-afx copied to clipboard

"keep whitespace" mode

Open bwaidelich opened this issue 6 years ago • 5 comments

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
`

bwaidelich avatar Aug 30 '18 10:08 bwaidelich

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

bwaidelich avatar Aug 30 '18 10:08 bwaidelich

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…

kdambekalns avatar Jun 25 '21 09:06 kdambekalns

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…

kdambekalns avatar Jun 25 '21 09:06 kdambekalns

https://github.com/neos/fusion-afx/blob/3774d2fd70769cc3448255d3dd52ff0b663fe811/Classes/Service/AfxService.php#L327 seems to be the correct location

creative-resort avatar Jun 25 '21 11:06 creative-resort

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

bwaidelich avatar Apr 23 '24 12:04 bwaidelich