Try 30 days of free premium.

Summaries contain HTML Tags

markus101 wrote 9 years ago: 1

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.


david wrote 9 years ago: 1

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?

markus101 wrote 9 years ago: 1

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.


david wrote 9 years ago: 1

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.

FlowDiscuss wrote 9 years ago: 1

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 ?


david wrote 9 years ago: 1

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.

tidusjar wrote 8 years ago: 1

+1 for removing the Html tags, I'm having to preform some extra parsing of the summaries to remove them, just feels strange.


MichaelDeBoey wrote 8 years ago: 1

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?

grandima wrote 8 years ago: 1

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.

roidy wrote 6 years ago: 1

+1 this is an api and as such should only return useful data and not formatting tags.

Adelin wrote 6 years ago: 1

you can use $summary_without_tags = strip_tags($summary); in php

roidy wrote 6 years ago: 1

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.

deleted wrote 6 years ago: 1

+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.


david wrote 6 years ago: 1

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.

Try 30 days of free premium.