@@ -72,12 +72,14 @@ function Hallway (sites) {
72 const users = []
72 const users = []
73 const channels = []
73 const channels = []
74 const tags = []
74 const tags = []
76 // Channels
77 // Channels
77 for (const id in words) {
78 for (const id in words) {
78 if (words[id].substr(0, 1) === '@') { users.push(words[id]) }
79 if (words[id].substr(0, 1) === '@') { users.push(words[id]) }
79 if (words[id].substr(0, 1) === '/') { channels.push(words[id]) }
80 if (words[id].substr(0, 1) === '/') { channels.push(words[id]) }
80 if (words[id].substr(0, 1) === '#') { tags.push(words[id]) }
81 if (words[id].substr(0, 1) === '#') { tags.push(words[id]) }
82+ if (words[id].substr(0, 4) === 'http') { links.push(words[id]) }
83 for (const id in users) {
85 for (const id in users) {
@@ -89,6 +91,9 @@ function Hallway (sites) {
89 for (const id in tags) {
91 for (const id in tags) {
90 entry.body = entry.body.replace(tags[id], `<span class='tag'>${tags[id]}</span>`)
92 entry.body = entry.body.replace(tags[id], `<span class='tag'>${tags[id]}</span>`)
94+ for (const id in links) {
95+ entry.body = entry.body.replace(links[id], `<a href='${links[id]}'>${links[id].replace('https://', '').replace('http://', '')}</a>`)
93 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
98 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
94 const highlight = filter === entry.author.toLowerCase()
99 const highlight = filter === entry.author.toLowerCase()
@@ -176,7 +181,7 @@ function Hallway (sites) {
176 return `${Math.floor(minutes / 1440)} days ago`
181 return `${Math.floor(minutes / 1440)} days ago`
179− function escapeHtml(unsafe) {
184+ function escapeHtml (unsafe) {
180− return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
185+ return unsafe.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')