4 ms·
It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.
by Leace 8y ago
It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.
- jolmg 8y agoI agree with you on the max-width. I can't see whatever benefit it's supposed to provide outweigh the annoyance of having to scroll horizontally when there is a lot of empty space to the right that could be used to display more text. I'm not too convinced on the wrapping of code, though.
- kakarot 8y agowhite-space: pre-wrap on a code block could lead to confusion. Any change should be an optional setting in your user profile. However you're definitely right about dropping the max-width property.
- masklinn 8y agoThat would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.
- vorpalhex 8y agoWhat is it with so many products (HN, Discord, Slack) building half assed markdown implementations that aren't actually markdown?
- rhacker 8y agoWhat's Markdown? - Slack product development (that was a joke but is likely the answer to your question)
- oldmanhorton 8y agoTo be pedantic, there's debate about what is "actually markdown". No one would say it's the flavor HN implements, but the easiest way to win some games is to simply not play
- quietbritishjim 8y agoThat would break any existing comments that happened to be using markdown syntax as punctuation. Although I suppose you could have a flag day for the changeover and format differently based on comment creation time. But I think the very limited formatting is just fine anyway. For the above comment as an example, I agree the code formatting looks awful, especially on mobile. But the version with >'s is ok, and I don't think proper bullet points or a quote bar would have improved it dramatically.
- Leace 8y agoConversations.im uses an interesting trick for rendering Markdown [0] - it leaves the syntax as is, so in the worst case you've got text with weird bold/italics, but the characters are 1:1 identical to what was sent. [0]: Actually not Markdown but a subset but it's not important.
- abraae 8y agoI would hate to see the day HN allowed any way to bold sections of text. It's way more restful purveying a page of uniformly restrained text.
- dahfizz 8y agoHow is that meaningfully different to italics in that regard?
- K2L8M11N2 8y agoBold text stands out when visually scanning the page, italics don't.
- masklinn 8y ago> I would hate to see the day HN allowed any way to bold sections of text. HN already has shitty italics (shitty in that it commonly matches and eats things you don't want to be italicised e.g. multiplications, pointers, … in part though not only because HN doesn't have inline code). "bold" can just be styled as italics, or it can be styled as a medium or semibold. It's not an issue, and even less worth it given how absolute garbage the current markup situation is.
- yen223 8y agoFor a site that's meant to target programmers, HN's handling of code blocks is pretty poor. Just give me the triple-tilde code block syntax please!
- masklinn 8y ago> For a site that's meant to target programmers, HN's handling of code blocks is pretty poor. Meh. It does literal code blocks, they work fine. That's pretty much the only markup feature which does, which is impressively bad given HN only has two markup feature: literal code blocks and emphasis. It's not like they're going to add code coloration or anything. And while fenced code blocks are slightly more convenient (no need to indent), pasting a snippet in a text editor and indenting it is hardly a difficult task.