Store newlines as <br /> tag in new posted Notes
ActivityStream assumes that content is HTML message: https://www.w3.org/TR/2017/REC-activitystreams-vocabulary-20170523/#dfn-content
To fullfill this assumption save newlines as <br /> during post creation
Signed-off-by: Nikolai Merinov [email protected]
- Resolves: #1139
- Target version: master
Summary
Suggested change should allow to store post in manner that allows to display it correctly on the web. Looks like other fediverse instances behave in similar manner. My only doubt is what better: use nl2br php function to have both newlines and <br \> tag, or use replace() call to have only <br \> tag
Updated according to improvements from #1090
My only doubt is what better: use nl2br php function to have both newlines and <br > tag, or use replace() call to have only <br > tag
Replace is better because mastodon uses "white-space: pre-wrap" as default style and using <br \>\n will look ugly on mastodon web.