about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-24 21:14:37 +0200
committerThibG <thib@sitedethib.com>2019-07-24 21:46:09 +0200
commit91da921dbb51f55bc926c3997ae558d735292a67 (patch)
treec4ddabdc0dc4d629ad5f8c7e1f2a55cb0e94c729
parent88e79c179a1a48feff3b16226c46f5885442651e (diff)
Fix links in status media having their title rewritten
-rw-r--r--app/javascript/flavours/glitch/components/status_content.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js
index 650b834de..befbe340f 100644
--- a/app/javascript/flavours/glitch/components/status_content.js
+++ b/app/javascript/flavours/glitch/components/status_content.js
@@ -26,7 +26,7 @@ export default class StatusContent extends React.PureComponent {
   };
 
   _updateStatusLinks () {
-    const node = this.node;
+    const node = this.contentsNode;
 
     if (!node) {
       return;
@@ -161,6 +161,10 @@ export default class StatusContent extends React.PureComponent {
     this.node = c;
   }
 
+  setContentsRef = (c) => {
+    this.contentsNode = c;
+  }
+
   render () {
     const {
       status,
@@ -241,6 +245,7 @@ export default class StatusContent extends React.PureComponent {
 
           <div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
             <div
+              ref={this.setContentsRef}
               style={directionStyle}
               tabIndex={!hidden ? 0 : null}
               dangerouslySetInnerHTML={content}
@@ -263,6 +268,7 @@ export default class StatusContent extends React.PureComponent {
           ref={this.setRef}
         >
           <div
+            ref={this.setContentsRef}
             dangerouslySetInnerHTML={content}
             lang={status.get('language')}
             className='status__content__text'
@@ -279,7 +285,7 @@ export default class StatusContent extends React.PureComponent {
           tabIndex='0'
           ref={this.setRef}
         >
-          <div className='status__content__text' dangerouslySetInnerHTML={content} lang={status.get('language')} tabIndex='0' />
+          <div ref={this.setContentsRef} className='status__content__text' dangerouslySetInnerHTML={content} lang={status.get('language')} tabIndex='0' />
           {media}
         </div>
       );