Fix links in status media having their title rewritten

This commit is contained in:
Thibaut Girka 2019-07-24 21:14:37 +02:00 committed by ThibG
parent 88e79c179a
commit 91da921dbb

View file

@ -26,7 +26,7 @@ export default class StatusContent extends React.PureComponent {
}; };
_updateStatusLinks () { _updateStatusLinks () {
const node = this.node; const node = this.contentsNode;
if (!node) { if (!node) {
return; return;
@ -161,6 +161,10 @@ export default class StatusContent extends React.PureComponent {
this.node = c; this.node = c;
} }
setContentsRef = (c) => {
this.contentsNode = c;
}
render () { render () {
const { const {
status, status,
@ -241,6 +245,7 @@ export default class StatusContent extends React.PureComponent {
<div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}> <div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
<div <div
ref={this.setContentsRef}
style={directionStyle} style={directionStyle}
tabIndex={!hidden ? 0 : null} tabIndex={!hidden ? 0 : null}
dangerouslySetInnerHTML={content} dangerouslySetInnerHTML={content}
@ -263,6 +268,7 @@ export default class StatusContent extends React.PureComponent {
ref={this.setRef} ref={this.setRef}
> >
<div <div
ref={this.setContentsRef}
dangerouslySetInnerHTML={content} dangerouslySetInnerHTML={content}
lang={status.get('language')} lang={status.get('language')}
className='status__content__text' className='status__content__text'
@ -279,7 +285,7 @@ export default class StatusContent extends React.PureComponent {
tabIndex='0' tabIndex='0'
ref={this.setRef} 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} {media}
</div> </div>
); );