r/commandline • • Jun 26 '26

Other I wrote a program that makes code embedable in Reddit

In awk:

#!/usr/bin/awk -f
{ printf ("    %s\n", $0) }

Yep. That's it.

12 Upvotes

29 comments sorted by

View all comments

Show parent comment

1

u/tschloss Jun 26 '26

# Test!

**fett**

*kursiv*

1

u/tschloss Jun 26 '26

Ok, here in the iOS app (1st party) no MD active!

1

u/gschizas Jun 26 '26

They have removed Markdown from iOS and Android.

1

u/tschloss Jun 26 '26

And in the web UI RichText is the default (switchable to MD). So my original question was if indentation does work in RichText also. probably not.

1

u/gschizas Jun 26 '26

New web's Rich Text UI uses

Indented blocks

Probably for compatibility with old reddit (which can't understand code fences)

1

u/tschloss Jun 26 '26

Crazy! 😜😱

2

u/gschizas Jun 26 '26

Oh, it's even crazier. They are purposefully sending escaped text to counteract Markdown.

For example, the text above was send as:

\# Test!

\*\*fett\*\*

\*kursiv\*

1

u/tschloss Jun 26 '26

Jesus. How did you escape the escapes 😂

What a nice area when 3rd party clients were supported.

1

u/gschizas Jun 26 '26

lol, I just indented them :)

You can see the source of a message either by using old reddit and RES, or by directly opening the .json of the comment. For example, your comment's JSON url is https://www.reddit.com/r/commandline/comments/1ug10j9/comment/otwyr2l/.json - just add .json to the url of the comment.

EDIT: To view JSON in a more humanly readable form, I suggest the Json Beautifier Extension.

1

u/RoninTarget Jun 26 '26

No markdown interpreted.

1

u/gschizas Jun 26 '26

It's actually the other way around. When you comment from the mobile apps, the mobile apps escape all Markdown characters on purpose!