diff --git a/src/invidious/views/components/subscribe_widget_script.ecr b/src/invidious/views/components/subscribe_widget_script.ecr
index c5e36b79..e2994c86 100644
--- a/src/invidious/views/components/subscribe_widget_script.ecr
+++ b/src/invidious/views/components/subscribe_widget_script.ecr
@@ -20,7 +20,7 @@ function subscribe(timeouts = 0) {
var fallback = subscribe_button.innerHTML;
subscribe_button.onclick = unsubscribe;
- subscribe_button.innerHTML = '<%= translate(locale, "Unsubscribe") %> | <%= sub_count_text %>'
+ subscribe_button.innerHTML = '<%= translate(locale, "Unsubscribe").gsub("'", "\\'") %> | <%= sub_count_text %>'
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
@@ -55,7 +55,7 @@ function unsubscribe(timeouts = 0) {
var fallback = subscribe_button.innerHTML;
subscribe_button.onclick = subscribe;
- subscribe_button.innerHTML = '<%= translate(locale, "Subscribe") %> | <%= sub_count_text %>'
+ subscribe_button.innerHTML = '<%= translate(locale, "Subscribe").gsub("'", "\\'") %> | <%= sub_count_text %>'
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {