make compat applies to titles as well now

This commit is contained in:
bingus_violet 2024-07-22 02:27:36 -05:00
parent 2dcedf0ff7
commit bb5f3a6bd1

View file

@ -24,7 +24,7 @@ function get_img_url(activity, size = "large_image") {
return null return null
} }
function makeCompat(string) { function makeCompat(string="") {
return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;") return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;")
} }
@ -136,7 +136,7 @@ module.exports = {
activity.assets = { "large_text": "", "small_text": "" } activity.assets = { "large_text": "", "small_text": "" }
} }
var text1 = onlyIfExists("<br><span style='font-size: 1.3rem;'>" + activity.song + "</span>", activity.song) || activity.details var text1 = onlyIfExists("<br><span style='font-size: 1.3rem;'>" + makeCompat(activity.song) + "</span>", activity.song) || activity.details
var text2 = onlyIfExists("By: " + activity.artist, activity.artist) || activity.state var text2 = onlyIfExists("By: " + activity.artist, activity.artist) || activity.state
var text3 = onlyIfExists("On: " + activity.album, activity.album != activity.song && activity.album) var text3 = onlyIfExists("On: " + activity.album, activity.album != activity.song && activity.album)