0

I am making a WebApp that dynamically loads news feeds (think a Pulse News WebApp) but I am having a problem that if an article has badly formed HTML (generally misplaced or missing end tags) it trashes my entire layout.

So, my question is: is there a way for me to either economically "fix" the HTML or store it some way other than in a hidden element so that it won't "break" the rest of my code?

Demo:
Fullscreen: http://jsfiddle.net/SO_AMK/4pFcm/embedded/result/
Normal: http://jsfiddle.net/SO_AMK/4pFcm/

(Example problematic article highlighted, it has a missing </i> tag)

Please note that this is not the entire app but a static portion. The actual app generates all HTML.

P.S. On a sidenote, does anybody have an idea as to why when you click on or next to the article byline (below the title) it scrolls the tiles of that feed?

Any ideas?

Thank you in advance.

A.M.K
  • 16,727
  • 4
  • 32
  • 64
  • Consider stripping out all the irrelevant markup and code from your js fiddle. This will make it easier to read and quicker to resolve, then you may get more responses. – Paul Fleming Jul 17 '12 at 22:10
  • if you are retrieving the articles via ajax, you could store them in a `data-` attribute using jQuery's `.data()` method to keep the markup from affecting the rest of your app – MrOBrian Jul 17 '12 at 22:14
  • Can it hold a full article without a problem? – A.M.K Jul 17 '12 at 22:14
  • @A.M.K: You can store up to 65,536 bytes of data in each HTMLElement attribute (http://stackoverflow.com/questions/2752457/max-length-of-an-html-attribute-value). – Cᴏʀʏ Jul 17 '12 at 22:17
  • That should be enough... I'll give it a try. – A.M.K Jul 17 '12 at 22:20
  • What about the "sidenote"? Any idea why it's scrolling? – A.M.K Jul 17 '12 at 22:20

0 Answers0