social icon indicating copy to clipboard operation
social copied to clipboard

Store newlines as <br /> tag in new posted Notes

Open mnd opened this issue 5 years ago • 2 comments

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

mnd avatar Nov 28 '20 09:11 mnd

Updated according to improvements from #1090

mnd avatar Dec 04 '20 11:12 mnd

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.

mnd avatar Dec 04 '20 11:12 mnd