diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index e7554074..f2c88cee 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -2,8 +2,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import PureRenderMixin from 'react-addons-pure-render-mixin'; import emojify from '../emoji'; -const hideContent = str => $('
').html(str).text().replace(/[^\s]/g, '█'); - const StatusContent = React.createClass({ contextTypes: { @@ -15,12 +13,6 @@ const StatusContent = React.createClass({ onClick: React.PropTypes.func }, - // getInitialState () { - // return { - // visible: false - // }; - // }, - mixins: [PureRenderMixin], componentDidMount () { @@ -67,10 +59,9 @@ const StatusContent = React.createClass({ render () { const { status, onClick } = this.props; - const hidden = false; // (status.get('sensitive') && !this.state.visible); - const content = { __html: hidden ? hideContent(status.get('content')) : emojify(status.get('content')) }; + const content = { __html: emojify(status.get('content')) }; - return
; + return ; }, }); diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss index b1249ff7..3446cfc8 100644 --- a/app/assets/stylesheets/components.scss +++ b/app/assets/stylesheets/components.scss @@ -90,6 +90,7 @@ word-wrap: break-word; font-weight: 300; overflow: hidden; + white-space: pre-wrap; .emojione { width: 18px; diff --git a/app/assets/stylesheets/stream_entries.scss b/app/assets/stylesheets/stream_entries.scss index 5e4ef75c..1e29ee71 100644 --- a/app/assets/stylesheets/stream_entries.scss +++ b/app/assets/stylesheets/stream_entries.scss @@ -153,6 +153,7 @@ color: #282c37; word-wrap: break-word; overflow: hidden; + white-space: pre-wrap; p { margin-bottom: 18px; diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 5748680a..04386d29 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -15,6 +15,7 @@ class Formatter html = status.text html = encode(html) html = simple_format(html, sanitize: false) + html = html.gsub(/\n/, '') html = link_urls(html) html = link_mentions(html, status.mentions) html = link_hashtags(html) @@ -42,7 +43,7 @@ class Formatter end def link_urls(html) - auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) do |text| + auto_link(html, link: :urls, html: { rel: 'nofollow noopener', target: '_blank' }) do |text| truncate(text.gsub(/\Ahttps?:\/\/(www\.)?/, ''), length: 30) end end