Too much decoding of entities going on.

In the feed for Camen Design (http://camendesign.com/rss) I spotted a weird blank space in the article ‘I Don’t Want To Do This Any More’. On closer inspection the culprit seems to be this code:
\<code\>&lt;video&gt;\</code\>
This might look horrible but it is because of how XML works. This should be decoded once into:
(Note: Get Satisfaction can’t handle this, there should be another CODE closing tag.)

```
 And then when displaying the feed content I should see the literal tag printed in my browser, styled as code. Currently what NewsBlur is doing is taking care of all entities. Making it: (Note: Get Satisfaction can’t handle this, there should be another CODE closing tag.)  
```

```
 This makes my browser insert (and try to render) a VIDEO element where there shouldn’t be one.`
1 Like

Ironically, NewsBlur is doing the same thing with this problem report. (Feed.) The final code block gets converted into a working (albeit empty) VIDEO element.

Before I start fixing this, I just want to point out the irony of the paragraph:

“It is this short-sightedness that immediately ‘gripped the nation’ the second HTML5 video became available. Profusely, blogs explained how to use JavaScript to detect HTML5 video support and insert the “video” element into the page. None seemed to see the irony of using JavaScript to insert an HTML element (probably because they couldn’t tell the difference). Would you use JavaScript to insert your static elements? No, you put the element in, and the browser handles it.”

Hah. Because this is exactly what’s happening, although inadvertently.

You got it: https://github.com/samuelclay/NewsBlu….

Turns out the auto linking of text links was also indiscriminately rewriting text, which ended up double-encoding any entities. Great bug!

1 Like

Did not expect the problem to be there to say the least.

Great bug!

If I keep finding edge-case bugs, can I win a premium membership? :wink: Hahaha.

Now looking for a way to mark this topic ‘fixed’. But maybe only you can do that?

I’m not actually paying for this support forum, so I have no real moderator abilities. It’s ok, though. Nobody else should now have this problem, and if they do, they can just read the whole thread.