iantrich / podcast-card

🎧 Podcast Player Card
MIT License
22 stars 3 forks source link

special characters in podcast title still trip up the card #6

Closed zen85 closed 4 years ago

zen85 commented 5 years ago

i posted this issue to the component-github already but i think it belongs here now.

i also see that i am not the only one looking at the closed issues. but the fix there apparently does not work?

if i add for example "Ö1 digital leben" podcast in gpodder.net the card shows it but does not list the podcasts. apparently it hates the "ö".

if i add "skeptics' guide to the universe" podcast the card breaks entirely. it really hates the "' ' "

does anyone have an idea where to look for that in the code? should be simple to fix and would make this everything i ever dreamed of...

zen85 commented 5 years ago

apparently with "Ö" the issue is somewhere here on line 2594: const list = this.shadowRoot.querySelector(#${target.podcast.replace(/[ )(]/g, "-").replace(/[^\w\s]/gi, '')});

the corresponding error in console: ` podcast-card.js?v=0:2594 Uncaught DOMException: Failed to execute 'querySelector' on 'DocumentFragment': '#1Wissenaktuell' is not a valid selector. at HTMLElement._togglePodcastEpisodes (http://192.168.1.103:8123/local/podcast-card.js?v=0:2594:38) at EventPart.handleEvent (http://192.168.1.103:8123/local/podcast-card.js?v=0:855:24) at HTMLElement.EventPart._boundHandleEvent (http://192.168.1.103:8123/local/podcast-card.js?v=0:821:46)

`

i dont think i can interpret the regex well enough to make sense of this. but maybe its something with that part that goes wrong since complex regex always seems like voodo... to me at least :)

iantrich commented 4 years ago

Forgot about this one. I'll take a look

iantrich commented 4 years ago

Give this a try: https://gist.github.com/iantrich/d243d08d48c37d6ed05207ef16cb0bac

iantrich commented 4 years ago

Should be fixed in https://github.com/custom-cards/podcast-card/releases/tag/1.0.4