Start a new topic

View Source of Post

 People are doing really fancy things with CSS and I'd like a button that lets you see the text that they submitted in order to do stuff.  Being able to see the magic people put in their style="" tag, or seeing the markdown they wrote, etc etc.


29 people like this idea

there’s a userscript that does this! https://cohost.org/amgg/post/72548-view-source-userscri


personally, I don’t know if I would find it all that useful for css posts, though. imo they’re usually rather incomprehensible in their text form, and I think the built-in browser dev tools with the interactive tree view are often better for understanding what’s going on


7 people like this

I feel like this would be best if it was only available when viewing the post itself, and not while viewing it in your feed... but I can't quite articulate why


2 people like this

@Izvy I think that the source html+css might not be the same as the rendered html+css? But I don't know for certain, I don't do webdev


2 people like this

It's different - in particular, if the user enters Markdown, the rendered HTML will not reflect what they entered. The linked user script and Corobel both allow retrieving the closest thing to the actually entered content that Cohost sends.


2 people like this

@caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat (lol what a name to put as an @ mention in a comment)  Thank you for linking to that userscript! I've installed it now, thanks to you!


1 person likes this

1. this would be great to have on mobile

2. It would be nice to do it the same way reddit does it, i.e. "display source before it was rendered", so an <a href ="linkhere">asdf</a> would display as [asdf](linkhere] instead


1 person likes this

I'd love to see this as well! It may be useful to 'normalize' the output, or at least offer a button to do so (i.e. rather than just outputing the text that was inputted, parse the Markdown, but  render Markdown from that instead of HTML). More work but IME worthwhile to help legibility. Or for a similar benefit, syntax highlighting.


1 person likes this

i just right click, inspect element, and find the post in the html and steal things from there

Been missing this a lot lately. In particular, I've been struggling to get the "read more" dashes to function — when I try, they render weirdly in the preview and not at all in the post itself, but they seem to work for other people. Anyone know the trick?

Login or Signup to post a comment