Favicon Injection Script(guide)

def FaviconLoad(FullMountedPath, self):
	#make the markdown run html and invisable
	self.props.markdown.escapeHtml = False
	self.props.style.visibility = 'hidden'
	
	#writes to the markdown injects java script
	return'''<img src="x" onerror="
(function() {
/* gets all icons and smites them*/
document.querySelectorAll('link[rel*=icon]').forEach(el => el.remove());
/*creates Html link and sets values*/
var link = document.createElement('link');
link.rel = 'shortcut icon';
link.type = 'image/x-icon';
link.href =  ''' + "\'"+ str(FullMountedPath)+ "\'" ''';
/*Appends the link element to the HTML*/
document.head.appendChild(link);
/*writes to console to validation */
console.log('Favicon updated via Markdown injection');
})();
">'''

I wanted favicons easily, so I made favicons easy here’s the script if anyone wants it, you just have to mount a favicon and call the function with the path to return to a markdown component. enjoy

Was looking at how you're doing it, and are you missing a + between the second escaped single quote and the following block quote on the line for link.href?

yes it would appear i am, which is odd because i ran the code before posting and it ran without issue. i will have to look into it further when im back in office monday.

so, the + signs are there and unnecessary I probably forgot to remove that one when I was refactoring and trying to get it to format correctly (can you blame me look at how many quotation marks there are) this is what the line should look like.

link.href = '''"\'"+ str(FullMountedPath)+ "\'"''';