I noticed the summaries for shows and episodes both contain HTML tags, I've seen both <p> and <em> tags.
Is it possible to get these filtered out? It looks like that info is used as-is in the UI, but as a consumer I don't want to be tied to those.
I noticed the summaries for shows and episodes both contain HTML tags, I've seen both <p> and <em> tags.
Is it possible to get these filtered out? It looks like that info is used as-is in the UI, but as a consumer I don't want to be tied to those.
HTML is indeed possible in summaries. I preserved the HTML tags in the API, because some consumers might be interested in them, and for others it should be easy to strip them out.
What language are you using on the client end? Is there no easy method to strip out HTML on your side?
C# - I'm not really concerned about being able to, just felt a little weird to have it there to begin with. Not a big issue, just wanted to check if it was expected.
Alright. I think it's useful enough to warrant keeping it in, as there are plenty of platforms (web, phonegap, android textview) that can natively handle HTML tags. We'll work on better API documentation in the future though to make details like this clear.
FYI I suggested it in another thread but I also think summaries should be html free. FlowDiscuss is a webapp and I still wouldnt want any HTML in the response I get from the different APIs I use. A way might be to have two field ? one with and one without HTML ?
Hmm, I don't want to include the summary twice for each item. On a call like a show's episode list that would almost double the response size.
If it turns out that not a single API consumer is interested in the HTML formatting we can consider changing it though. Will keep this thread open to gather more feedback for a while.
+1 for removing the Html tags, I'm having to preform some extra parsing of the summaries to remove them, just feels strange.
My view on this is that i could be handy to let them in.
But maybe you can add an extra attribute to the API endpoint htmltags=true or something?
tidusjar wrote:
+1 for removing the Html tags, I'm having to preform some extra parsing of the summaries to remove them, just feels strange.
Agree with you. I'd like to get an extra option to remove them.
+1 this is an api and as such should only return useful data and not formatting tags.
you can use $summary_without_tags = strip_tags($summary); in php
Adelin wrote:
you can use $summary_without_tags = strip_tags($summary); in php
Great if you're using php....
The tags are easy to strip out in most languages using simple regex, but that's not the point. The point is they shouldn't even be there to begin with.
+1 But only if we can maintain the line breaks in the summary object else we will lose all formatting for paragraphs etc.
Also some people may already expect the formatting in the api so I am not sure this should be changed without versioning the endpoint which would be more work.
Yeah, to summarize: if I had to design a new API I would reconsider whether to use HTML formatting for the summaries. But now that we have it, it's unlikely to go away any time soon.
Including the summary twice (once with HTML and once without) would be a huge waste of bandwidth. Removing HTML from the existing field is impossible because it would break everyone who depends on it. Introducing versioning will likely happen at some point, but not merely for a single small change like this.
Since it's trivial to remove HTML in almost every programming language it shouldn't be large problem either way.
Piggy-backing on what David said, this is exactly what I do with pytvmaze: https://github.com/srob650/pytvmaze/blob/16ed096d464adcd3d12a610e413996918715930e/pytvmaze/tvmaze.py#L509