Add logic to parse and remove any instances of https://twitter.com by replacing with user's preference
The issue was happening since the original regex is checking for href tags only, so I tried a simpler approach of searching for https://twitter.com instead whenever the regex does not match the input string Add Nodemon package to dev dependencies for local debugging
This commit is contained in:
parent
22b63a3415
commit
c71bf6ee48
|
@ -261,8 +261,14 @@ module.exports = function(request, fs) {
|
|||
str = str.replace(youtubeRegex, protocol + user_preferences.domain_youtube)
|
||||
|
||||
if(typeof(user_preferences.domain_twitter) != 'undefined')
|
||||
if(user_preferences.domain_twitter)
|
||||
str = str.replace(twitterRegex, protocol + user_preferences.domain_twitter)
|
||||
if(user_preferences.domain_twitter){
|
||||
if (twitterRegex.test(str)){
|
||||
str = str.replace(twitterRegex, protocol + user_preferences.domain_twitter)
|
||||
}
|
||||
else {
|
||||
str = str.replace('https://twitter.com',protocol + user_preferences.domain_twitter)
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof(user_preferences.domain_instagram) != 'undefined')
|
||||
if(user_preferences.domain_instagram)
|
||||
|
|
|
@ -210,7 +210,7 @@ module.exports = function() {
|
|||
}
|
||||
comments_html += replies_html + '</details></div>'
|
||||
} else {
|
||||
if(comment.children.length > 0) {
|
||||
if(comment.children.length > 0) {
|
||||
let parent_id = comment.parent_id.split('_')[1]
|
||||
let load_comms_href = parent_id
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node app.js"
|
||||
"start": "node app.js",
|
||||
"dev": "nodemon app.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"compression": "^1.7.4",
|
||||
|
@ -34,5 +35,7 @@
|
|||
"pug": "^3.0.2",
|
||||
"redis": "^3.1.2"
|
||||
},
|
||||
"devDependencies": {}
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.20"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue