From 56312f8f53e210b299076c9d420fab2fb59502bb Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Thu, 10 Sep 2015 11:06:08 -0400
Subject: Changed one instance of textToJsx to use new text formatting for
 testing purposes

---
 web/react/components/post_body.jsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'web/react/components/post_body.jsx')

diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index d9b8f20ce..e08936923 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -5,6 +5,7 @@ const FileAttachmentList = require('./file_attachment_list.jsx');
 const UserStore = require('../stores/user_store.jsx');
 const Utils = require('../utils/utils.jsx');
 const Constants = require('../utils/constants.jsx');
+const TextFormatting = require('../utils/text_formatting.jsx');
 const twemoji = require('twemoji');
 
 export default class PostBody extends React.Component {
@@ -12,6 +13,7 @@ export default class PostBody extends React.Component {
         super(props);
 
         this.parseEmojis = this.parseEmojis.bind(this);
+        this.handleClick = this.handleClick.bind(this);
 
         const linkData = Utils.extractLinks(this.props.post.message);
         this.state = {links: linkData.links, message: linkData.text};
@@ -29,6 +31,12 @@ export default class PostBody extends React.Component {
         const linkData = Utils.extractLinks(nextProps.post.message);
         this.setState({links: linkData.links, message: linkData.text});
     }
+    handleClick(e) {
+        let mentionAttribute = e.target.getAttributeNode('data-mention');
+        if (mentionAttribute) {
+            Utils.searchForTerm(mentionAttribute.value);
+        }
+    }
     render() {
         const post = this.props.post;
         const filenames = this.props.post.filenames;
@@ -135,7 +143,7 @@ export default class PostBody extends React.Component {
                     key={`${post.id}_message`}
                     className={postClass}
                 >
-                    {loading}<span>{inner}</span>
+                    {loading}<span onClick={this.handleClick} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}/>
                 </p>
                 {fileAttachmentHolder}
                 {embed}
-- 
cgit v1.2.3-1-g7c22


From 15aa853da5f6be8a95970d73a700afc6b626c572 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Mon, 14 Sep 2015 11:48:07 -0400
Subject: Removed all calls to textToJsx and replaced them with calls to
 TextFormatting

---
 web/react/components/post_body.jsx | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

(limited to 'web/react/components/post_body.jsx')

diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index e08936923..df4ed3d57 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -13,7 +13,6 @@ export default class PostBody extends React.Component {
         super(props);
 
         this.parseEmojis = this.parseEmojis.bind(this);
-        this.handleClick = this.handleClick.bind(this);
 
         const linkData = Utils.extractLinks(this.props.post.message);
         this.state = {links: linkData.links, message: linkData.text};
@@ -31,17 +30,10 @@ export default class PostBody extends React.Component {
         const linkData = Utils.extractLinks(nextProps.post.message);
         this.setState({links: linkData.links, message: linkData.text});
     }
-    handleClick(e) {
-        let mentionAttribute = e.target.getAttributeNode('data-mention');
-        if (mentionAttribute) {
-            Utils.searchForTerm(mentionAttribute.value);
-        }
-    }
     render() {
         const post = this.props.post;
         const filenames = this.props.post.filenames;
         const parentPost = this.props.parentPost;
-        const inner = Utils.textToJsx(this.state.message);
 
         let comment = '';
         let postClass = '';
@@ -143,7 +135,11 @@ export default class PostBody extends React.Component {
                     key={`${post.id}_message`}
                     className={postClass}
                 >
-                    {loading}<span onClick={this.handleClick} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}/>
+                    {loading}
+                    <span
+                        onClick={TextFormatting.handleClick}
+                        dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}
+                    />
                 </p>
                 {fileAttachmentHolder}
                 {embed}
-- 
cgit v1.2.3-1-g7c22

