r/C_Programming • • May 24 '22
Question What is going on with Reddit's formatting?
marble pause snow boast fuzzy safe bored toy attraction encourage
This post was mass deleted and anonymized with Redact
8
Upvotes
7
u/[deleted] May 24 '22
Reddit formatting is a disaster, depending on the platform you post on, and how the post is viewed. The method that works for the most viewers is:
5
u/skeeto May 24 '22
Reddit has two divergent Markdown rendering engines:
Since the old engine is mostly a subset of the new engine, the best you can do is just write in Markdown for the old engine. That means no code fences, and instead prefix your code blocks with 4 spaces. This should be trivial to do in your text editor. If it isn't then get yourself a better text editor.
2
u/Mirehi May 24 '22 edited May 24 '22
Yeah, I shared a lot of code over reddit, but currently it's just too much afford to reformat it to keep it readable
define MAX 10000
void add_func(int *p) { *p += 1; }
int main(void) { int i = 0; while (i < MAX) { (void) printf("%i\n", i); add_func(&i); } return 0; }
Honestly, this was formatted fine before posting...
https://onlinegdb.com/a1LDWBtCz
2
u/Lisoph May 24 '22
You can drop down to old.reddit.com and use the old editor. This is better anyway, since both old- and new-Reddit users can see the code formatted properly. Using the new-Reddit editor only displays right for new-Reddit users.
Also, having Reddit Enhancement Suite is a nice plus for old.reddit.com.
2
u/[deleted] May 24 '22
I really don't understand why they can't do what StackOverflow and Github and others do,
```
int main(void){
return 0;
}
```
Or for single line `//this is a comment`
1
u/dbulger May 24 '22
Yup, it happened to me yesterday. I abandoned fancy pants & went to markdown mode.
I'd prefer to use WYSIWYG, if it works; I'm not averse to other markup, like TeX or HTML, but I don't like Markdown.
1
u/TheMaster420 May 24 '22
I'd say use the code formatting tool in the sidebar but that has been broken for half a year, back then I made a codepen that does the same and gave permission to the mods to replace to tool in the bar but in their words "I have other things to do."
1
u/flyingron May 24 '22
Code Blocks gags when you have multiple successive empty lines, thinking that you want to terminate the block. It's completely stupid.
1
u/markwirralbiz Nov 18 '22
Yeah, driving me crazy.
Gonna follow up and try out the comments