Automatically link urls

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/31/head
Julius Härtl 2018-11-15 15:59:04 +01:00
rodzic 1da82646e8
commit 81ff286ad8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -28,6 +28,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"linkifyjs": "^2.1.7",
"nextcloud-axios": "^0.1.2",
"nextcloud-vue": "^0.4.2",
"uuid": "^3.3.2",

Wyświetl plik

@ -25,6 +25,7 @@
<script>
import { Avatar } from 'nextcloud-vue'
import linkifyStr from 'linkifyjs/string';
export default {
name: 'TimelineEntry',
@ -43,7 +44,7 @@ export default {
formatedMessage: function() {
let message = this.item.content
message = message.replace(/(?:\r\n|\r|\n)/g, '<br />')
return message
return message.linkify()
}
}
}