3

I understand the advantages of using markdown in local text files, and then taking those files and generating HTML. This is great for documentation, readme's in git repositories and posts for static site generators. It is very simple to create markdown syntax in any text editor, it's human readable, and you can create HTML from markdown relatively easily.

What I don't understand, is the advantages of using a wysiwyg editor for markdown in web applications, especially those that use a database server. (non-flat-file). I thought the whole point of using markdown was to remove the need for a wysiwyg editor. What is the advantage of using a markdown wysiwyg editor over an editor that just outputs HTML (avoiding the overhead of converting markdown to HTML in the process)?

clarification: basically I'm looking for technical advantages to having a WYSIWYG editor output markdown instead of HTML. To the end user the text form will look the same, so it's only dealing with markdown/html in the backend of an application. Anchor CMS sorta does this, and I'm wondering if there is an advantage over just plain HTML output.

meskarune
  • 155

3 Answers3

11

Why Markdown?

What is the advantage of using a markdown wysiwyg editor over an editor that just outputs HTML?

  • Because there are cases where you can't use a WYSIWYG editor, and should revert to text mode.

    Example: diff of a question or an answer on Stack Exchange. Sometimes, you can simply compare the rendered layout. But there are cases where the rendered layout is not explicit enough, and watching Markdown helps in understanding what was changed.

  • Because Markdown is more compact. Storing HTML instead of Markdown would take more place in the database.

    This is a lame argument, given the price per GB today. Besides, in most cases, HTML is stored side by side with Markdown in the database in order to generate the HTML once, and regenerate it only when Markdown is changed.

  • Because if the post was originally written in Markdown, you should keep it if you want to show it later to the author. If you convert everything to HTML and try to reconstitute Markdown from HTML later, there are chances the Markdown would not correspond to the original one.

    A basic example: for titles in my answers on Stack Exchange, I put two dashes like this:

    This is a title in Markdown
    --
    

    Other persons would prefer:

    This is a title in Markdown
    ---------------------------
    

    Others would rather write:

    ## This is a title in Markdown
    

    When I work in vim, I use the third format, because it feels more natural. But not on Stack Exchange.

    Those three variants produce the same HTML. By recreating Markdown from HTML, you'll pick one of those three formats, and annoy people who are using two other variants.

Why a WYSIWYG editor for Markdown?

What I don't understand, is the advantages of using a wysiwyg editor for markdown in web applications

You work in IT. You understand Markdown and are willing to learn it. Right.

My grand-mother never worked in IT. She is willing to click on the bold "B" icon to make the text bold, or on the nice landscape in a frame to insert an image. But inserting dashes and stars? I don't think so. Probably, she doesn't even know there is "#" key on the keyboard.

I hate PHPBB. There are many reasons for that, but one minor reason is the fact that I need to type [b][/b] just to insert some bold text. That's just crazy. On a French keyboard, it requires some effort. Currently, I'm typing with a Belgian keyboard, and it took me 30 seconds just to find "[" and "]" keys.

Markdown is easier, but still, persons who are habituated to a different format and who don't care about Markdown either:

  • Won't use formatting at all, or:

  • Avoid using the website which uses Markdown.

Having a WYSIWYG editor helps those people to avoid thinking about the characters they need to type, and focus on the intention, i.e. how do they need to format the piece of text.

3

Programmers like markup languages (Wikipedia markup, Markdown, HTML, SGML, etc.). Non-technical users like WYSIWYG editors. It has been this way since the first attempts at computerized typesetting (e.g., RUNOFF, 50 years old this year).

2

Real example: Confluence, a wiki made by Atlassian. It used to have both a markdown and a WYSIWYG editor in it, and you could flip between the modes. They removed the markdown mode and I was angry because it gave me better control/ability to do what I explicitly wanted, rather than fighting the WYSIWYG editor. (I think they still have an auto markdown-to-rich-text-as-you-type feature of sorts?) Certain things - like say, table layout - are definitely easier in markdown. So two parts: better/faster creation than a WYSIWYG editor, and more explicit control when the WYSIWYG editor fails you or is ironically more convoluted than the markdown itself.

Side note: I'm not actually sure how it is stored in the database under the hood. I have a feeling it was removed because some shiny new WYSIWYG feature didn't have a good corresponding feature in the markdown.

J Trana
  • 1,389
  • 9
  • 17