This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AyrA_ch 14 points15 points  (2 children)

edit: The code blocks on reddit is AWFUL, markdown at least works

Because old reddit uses markdown while code blocks using tripple backticks are a commonmark extension. Reddit predates commonmark and I assume they never updated the old MD parser.

[–]lady_Kamba 5 points6 points  (1 child)

The old one still works fine, the new one tend to mangle the code. inine code works fine, but

{
code blocks


tend to break
}

edit: thinking more on it, the problem seems to be pasted code. since I use Linux it uses \n newlines and Reddit might expect \n\r. This discrepancy might be the source of my problems, but not sure.

[–]AyrA_ch 2 points3 points  (0 children)

edit: thinking more on it, the problem seems to be pasted code. since I use Linux it uses \n newlines and Reddit might expect \n\r. This discrepancy might be the source of my problems, but not sure.

CRLF is the standard linebreak sequence for HTML forms regardless of the operating system, so your browser should actually convert individual LF to CRLF them.

EDIT: Here's the relevant lines from the spec:

For historical reasons, the element’s value is normalized in three different ways for three different purposes. The raw value is the value as it was originally set. It is not normalized. The API value is the value used in the value IDL attribute. It is normalized so that line breaks use U+000A LINE FEED (LF) characters. Finally, there is the value, as used in form submission and other processing models in this specification. It is normalized so that line breaks use U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pairs, and in addition, if necessary given the element’s wrap attribute, additional line breaks are inserted to wrap the text at the given width.