0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 22:52:40 +00:00

Replace with toWellFormed()

This commit is contained in:
Trevor Buckner
2024-12-15 23:44:56 -05:00
committed by GitHub
parent 2abc2b13f0
commit 56f348f7ed

View File

@@ -380,15 +380,7 @@ const EditPage = createClass({
**[Homebrewery Link](${global.config.publicUrl}/share/${shareLink})**`;
let encodedTitle;
try {
encodedTitle = encodeURIComponent(title);
} catch (error) {
console.error("Error encoding title for Reddit link:", error);
encodedTitle = encodeURIComponent("Check out my homebrew!"); // Fallback title
}
return `https://www.reddit.com/r/UnearthedArcana/submit?title=${encodedTitle}&text=${encodeURIComponent(text)}`;
return `https://www.reddit.com/r/UnearthedArcana/submit?title=${encodeURIComponent(title.toWellFormed())}&text=${encodeURIComponent(text)}`;
},
renderNavbar : function(){