3

Sorry, if it is a very basic question. I wanted to know how SE store and maintain data?

  1. How is an answer stored in the database such that when retrieved the formats provided by the editing bar (in the below image) are maintained?

editing bar

  1. Especially, how are code snippets of javascript (and like) are handled such that it does not harm their front-end website view, back-end database storage and serving computers?

Can someone help me with a very simple example, please?

Showing a webpage which accepts formatted post from a user. How is it made safe for storage and how is it retrieved back to be displayed in the original format specified by the user?

9
  • 3
    This is probably better on Meta SE, but to answer your first question, they store markdown, which is what those buttons actually generate in your post. The website knows how to create posts from markdown. Commented Apr 24, 2015 at 19:22
  • 2
    And naturally, they pre-cook the markdown to reduce overhead for rendering. Commented Apr 24, 2015 at 19:23
  • 2
    @BradleyDotNET No, the markdown-to-HTML conversion of posts is done once, with the HTML stored on the server. This is unlike comments, which are converted every time the page renders. Source: balpha's post.
    – user3717023
    Commented Apr 24, 2015 at 19:32
  • 2
    This seems a bit broad.
    – George Stocker Mod
    Commented Apr 24, 2015 at 19:32
  • @2mkgz thanks for the info, I stand corrected Commented Apr 24, 2015 at 19:35
  • I'm positive you both must be right. Prerendering into HTML and then saving the HTML, sure, but surely the Markdown version is also stored? Rather than converting HTML back to MD just before editing?
    – Jongware
    Commented Apr 24, 2015 at 19:55
  • @Jongware Yes, they're probably both stored. 2mkgz never specified that the markdown wasn't also stored, noone has actually.
    – Kevin B
    Commented Apr 24, 2015 at 19:59
  • 2
    @nerdspal I assume you're asking this because you're building an application of your own that is using markdown... If you asked this kind of question on SO or Programmers, we could have possibly answered with the several different ways this could be done with pros/cons for each. But with the question being here, we have to instead focus on what SE is doing.
    – Kevin B
    Commented Apr 24, 2015 at 20:02
  • Can anyone migrate it to SO or Programmers please? I do not have enough privileges.
    – Xameer
    Commented Apr 24, 2015 at 20:04

0

Browse other questions tagged .