top | item 21020162

Show HN: I made a browser extension that fixes Hacker News' block formatting

18 points| corollari | 6 years ago |github.com

13 comments

order

guessmyname|6 years ago

Here is an example of the problem this extension fixes:

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
My “solution” is to add asterisks around the text to make it Italic, like so:

> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Here are the official formatting guidelines: https://news.ycombinator.com/formatdoc

quietbritishjim|6 years ago

Here is the correct fix for that:

> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lines starting with four spaces are for code, not for quotations. In that situation you usually really do want a horizontal scroll bar rather than line wrapping, and this breaks that for actual code. That's also why it uses a fixed width font, which makes no sense at all for quotations.

Hacker News is deliberately very light on formatting, and I prefer it that way. The only thing that needs fixing is a bit of user education not to misuse the block formatting feature. Maybe there should be a list of formatting options below the reply box, with the idea of just sticking a text annotation on quotations mentioned explicitly. (A comment preview would also be nice, mostly so you could read your comment back in a proportional-width font before you post it.)

floatingatoll|6 years ago

Describing your advocacy against the official position as “fixing” is playing political games with framing and will worsen the site experience for the rest of us as users install and use it.

The official policy says:

https://news.ycombinator.com/formatdoc

> This is intended for code.

aasasd|6 years ago

The Stylus addon is a more generic solution, it works on phones: https://addons.mozilla.org/en-US/firefox/addon/styl-us/

As a bonus, you can fix the ‘[-]’ comment collapse link by making it five times wider. And crank up the font size.

The primary annoyance with this approach is that you can't look up the tag hierarchy and classes on a phone, at least I haven't found an extension that would let me do it even on the desktop (even though I think I've seen some, years ago).

harel|6 years ago

Am I "missing" something? I don't get those scrollbar comment layout... Where is the problem being fixed?

quietbritishjim|6 years ago

It's only really a problem on mobile

crispyporkbites|6 years ago

Why isn’t HN open source? It is after all hacker, news

RandomBacon|6 years ago

An older/vanilla version of HN is. Since then, secret sauce algorithms have been added. If it was public, it might be easier for someone to game the system.

It's written in Arc (a dialect of Lisp) and included in the Arc distribution:

https://news.ycombinator.com/item?id=1390685