Linkify search results properly
This commit is contained in:
parent
8eea1e5cb0
commit
eca5761098
File diff suppressed because one or more lines are too long
@ -1,12 +1,9 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import Autolinker from 'autolinker';
|
import { timestamp, linkify } from '../util';
|
||||||
import { timestamp } from '../util';
|
|
||||||
|
|
||||||
export default class Search extends PureComponent {
|
export default class Search extends PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const { result } = this.props;
|
const { result } = this.props;
|
||||||
const content = Autolinker.link(result.content, { stripPrefix: false });
|
|
||||||
|
|
||||||
const style = {
|
const style = {
|
||||||
paddingLeft: `${window.messageIndent}px`,
|
paddingLeft: `${window.messageIndent}px`,
|
||||||
textIndent: `-${window.messageIndent}px`
|
textIndent: `-${window.messageIndent}px`
|
||||||
@ -19,7 +16,7 @@ export default class Search extends PureComponent {
|
|||||||
{' '}
|
{' '}
|
||||||
<span className="message-sender">{result.from}</span>
|
<span className="message-sender">{result.from}</span>
|
||||||
</span>
|
</span>
|
||||||
<span dangerouslySetInnerHTML={{ __html: ` ${content}` }} />
|
<span>{' '}{linkify(result.content)}</span>
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user