|
|
|
@ -197,7 +197,7 @@ function htmlFormatMsg( msg, output, mentions ) {
@@ -197,7 +197,7 @@ function htmlFormatMsg( msg, output, mentions ) {
|
|
|
|
|
if( space != -1 ) url = tmp.substring(0,space); else url = tmp; |
|
|
|
|
if( url.length ) { |
|
|
|
|
msg = tmp.substr(String(url).length); |
|
|
|
|
url = url.replace('&', '&'); |
|
|
|
|
url = url.replace(/&/g, '&'); |
|
|
|
|
var extLinkTemplate = $("#external-page-link-template").clone(true); |
|
|
|
|
extLinkTemplate.removeAttr("id"); |
|
|
|
|
|
|
|
|
@ -309,6 +309,7 @@ function _extractUsername(s) {
@@ -309,6 +309,7 @@ function _extractUsername(s) {
|
|
|
|
|
// internal function for htmlFormatMsg
|
|
|
|
|
function _extractHashtag(s) { |
|
|
|
|
var hashtag = ""; |
|
|
|
|
s = reverseHtmlEntities(s); |
|
|
|
|
for( var i = 0; i < s.length; i++ ) { |
|
|
|
|
if( " \n\t.,:/?!;'\"()[]{}*".indexOf(s[i]) < 0 ) { |
|
|
|
|
hashtag += s[i]; |
|
|
|
@ -320,6 +321,20 @@ function _extractHashtag(s) {
@@ -320,6 +321,20 @@ function _extractHashtag(s) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function escapeHtmlEntities(str) { |
|
|
|
|
return str.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"').replace("'", '''); |
|
|
|
|
return str |
|
|
|
|
.replace(/&/g, '&') |
|
|
|
|
.replace(/</g, '<') |
|
|
|
|
.replace(/>/g, '>') |
|
|
|
|
.replace(/"/g, '"') |
|
|
|
|
.replace(/'/g, '''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function reverseHtmlEntities(str) { |
|
|
|
|
return str |
|
|
|
|
.replace(/&/g, '&') |
|
|
|
|
.replace(/</g, '<') |
|
|
|
|
.replace(/>/g, '>') |
|
|
|
|
.replace(/"/g, '"') |
|
|
|
|
.replace(/'/g, "'"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|