6 ms·
I am continually impressed by the markup Wikipedia generates. They've managed to pull in pretty link previews, scientific notation and a grid layout, whilst bu
by shakna 9y ago
I am continually impressed by the markup Wikipedia generates.
They've managed to pull in pretty link previews, scientific notation and a grid layout, whilst building a highly nested markup structure?
The remarkable part? Wikipedia works great inside a text browser like elinks. It works great in a modern browser. Without sacrificing the interactivity people have grown to expect.
- xab9 9y agoLast time I checked, their markup was pretty much nightmare fuel, but it should work fine with IE5, I'm sure :)
- baud147258 9y agoIt works well for the latest (and last) version of IE, at least.
- xab9 9y agoUsing IE11 with the emulator switched to IE5 I can assure you, it works in IE5. At least the main layout, no popup though :D Still equal parts scary and astonishing.
- seba_dos1 9y agoWikipedia is a content-heavy website first, webapp only second. If it's written correctly, then of course it's going to work in IE5 - maybe with some parts of the layout looking ugly, maybe with some margins being wrong, some media not being embedded, but generally should be usable. Nowadays it's fine for a webdev to not test their pages on IE5, but when the page is done right, there is no reason for it not to work in IE5, lynx, w3m or Netscape Navigator. Really, it's just a webdeveloper's job done right.
- xab9 9y agoNope, it's not "done right". It's a table layout from the nineties. But probably there's an api so noone would have to scrape a wiki page, I never needed to do that fortunately :)
- worble 9y agoAnd what exactly is not "done right" about that? If it displays the information it's supposed to in a clean and organised way, and loads as fast as any other website, then I couldn't care less if it's a '90's table layout' or using whatever the hot new JS framework is.
- Nadya 9y agoTry to read today's Featured Article in a text-to-speech program. The markup is so mangled it can't even read a complete sentence because it breaks anytime the text links out.
- shakna 9y agoJAWS didn't have any issues for me, which reader are you using?
- Nadya 9y agoNVDA - aka the "2nd choice" - but I think it may have been a configuration issue on my end as the markup on the page, after looking into why NVDA was struggling with it, is just a <p> with some <a> in it which NVDA should handle fine.
- shakna 9y agoNVDA can be difficult to configure, for sure. I couldn't get it to play nicely with Sublime, probably my fault. Reason I shelled out for JAWS.
- 9y ago
- saagarjha 9y agoWikipedia's markup is just terrible for trying to do any sort of scraping or analysis. I once tried to write a script that pulled the latest version of macOS from the sidebar of this article[1] and I gave up because it was difficult and brittle in a way that made it nearly impossible. I'd probably have better results parsing the HTML with a regex. Likewise, I know a friend who literally had to scrap an entire project because Wikipedia made it so difficult to get the text of an article without non-word entities in it. [1] https://en.wikipedia.org/wiki/MacOS https://en.wikipedia.org/wiki/MacOS
- shakna 9y agoOh, I know. The markup is incomprehensible, but not to a render engine. It doesn't even seem to impact loading speed. It generates amazing machine-text. As for scraping... Parsing the hell that is wikitext is all you can do. Or apparently, pipe it through a text browser.
- saagarjha 9y ago> pipe it through a text browser That's an interesting idea, and one that I hadn't thought of, but I'd place it closer to matching HTML with regex than actual "parsing". I might use it if I'm really desperate though.
- TuringTest 9y agoHave you tried using the mediawiki API [1], or any of the alternatives?[2] I don't know how well they work, but the built-in parser should give you the text without markup. And since they switched to Parsoid [3] to support the Visual Editor, the've polished the wikitext formal specification so all instances of markup have a well-defined structure. [1] https://www.mediawiki.org/wiki/API:Parsing_wikitext https://www.mediawiki.org/wiki/API:Parsing_wikitext [2] https://www.mediawiki.org/wiki/Alternative_parsers https://www.mediawiki.org/wiki/Alternative_parsers [3] https://www.mediawiki.org/wiki/Parsoid https://www.mediawiki.org/wiki/Parsoid
- rspeer 9y ago
- fwdpropaganda 9y agoTo me the remarkable part is that Wikipeda stills works great without javascript.