From 74c0914517d687e01fe6eafd2bfe7dd5c49c092f Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 4 Dec 2017 09:51:17 -0200 Subject: [PATCH] Support --- app/containers/message/Reply.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/containers/message/Reply.js b/app/containers/message/Reply.js index 36c55adc7..5fcfe3a7b 100644 --- a/app/containers/message/Reply.js +++ b/app/containers/message/Reply.js @@ -57,6 +57,14 @@ const onPress = (attachment) => { } Linking.openURL(attachment.title_link || attachment.author_link); }; + +// Support +const formatText = text => + text.replace( + new RegExp('(?:<|<)((?:https|http):\\/\\/[^\\|]+)\\|(.+?)(?=>|>)(?:>|>)', 'gm'), + (match, url, title) => `[${ title }](${ url })` + ); + const Reply = ({ attachment, timeFormat }) => { if (!attachment) { return null; @@ -86,7 +94,7 @@ const Reply = ({ attachment, timeFormat }) => { }; const renderText = () => ( - attachment.text ? : null + attachment.text ? : null ); const renderFields = () => {