about summary refs log tree commit diff
path: root/app/assets
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-11 23:08:46 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-11 23:08:46 +0100
commit6a5036ab19276b57a44f2d81d7df85a83e872800 (patch)
tree5bec00f2ed156caf1674ad7edef18db38e37c467 /app/assets
parente90fcb46e3e5bc4144d8777c2267bec638e327a0 (diff)
Fix whitespace preservation in status text
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/components/components/status_content.jsx13
-rw-r--r--app/assets/stylesheets/components.scss1
-rw-r--r--app/assets/stylesheets/stream_entries.scss1
3 files changed, 4 insertions, 11 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx
index e75540741..f2c88cee0 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 => $('<p>').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 <div className='status__content' style={{ cursor: 'pointer', color: hidden ? '#616b86' : null }} dangerouslySetInnerHTML={content} onClick={onClick} />;
+    return <div className='status__content' style={{ cursor: 'pointer' }} dangerouslySetInnerHTML={content} onClick={onClick} />;
   },
 
 });
diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss
index b1249ff7e..3446cfc87 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 5e4ef75c2..1e29ee718 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;