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.

4
  • 4
    What do you mean specifically by "using a wysiwyg editor for markdown?" Have you found such an editor, and wonder why it exists? Which one? Stack Exchange uses something in-between; it's not a wysiwyg editor (you still have to type markdown), but you get a preview window that let's you see what you are getting before you save your post. Jun 14, 2014 at 23:37
  • hallojs.org/demo/markdown and lab.lepture.com/editor are examples. Basically an editor that is the same as WYSIWYG HTML editors, but for markdown.
    – meskarune
    Jun 15, 2014 at 17:09
  • 4
    No, the point in removing HTML and creating your own markup (or using markdown) is to sidestep loads of potential XSS issues while also keeping content in the box. Jun 16, 2014 at 19:33
  • If you know of WYSIWYG editors that output better markdown than Hallo, there's a question looking for answers at webmasters.stackexchange.com/questions/22921/… Apr 11, 2015 at 10:03

3 Answers 3

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.

5
  • +1 Some AZERTY users aren't even aware of the AltGr key and its uses! Jun 16, 2014 at 11:01
  • I know writing markdown is easier than html, and I know people who don't want to learn a markup language would rather have a WYSIWYG editor, but WHY use such a thing to create markdown when you could just output HTML instead, and not deal with converting markdown to HTML?
    – meskarune
    Jun 16, 2014 at 18:47
  • 7
    Unfortunately, with the question closed, I can't post an answer, but the real answer is this: markdown can be processed and displayed without security concerns, but HTML requires careful filtering to avoid cross-site scripting attacks, and many filters have been shown to be broken in the past, so even when using one it is still a security risk.
    – Jules
    Jun 16, 2014 at 20:33
  • @meskarune: have you read the three points in the first part of my answer? Jun 17, 2014 at 12:04
  • @meskarune if you think, this answer answers your questions, plz consider to mark this answer as accepted.
    – kmonsoor
    Feb 7, 2016 at 17:14
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
  • 1
    God do I feel old now.
    – MetaEd
    Jun 15, 2014 at 20:39
  • @MετάEd I feel your pain :-) Jun 16, 2014 at 10:55
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.

1
  • Note: this post was clarified after this answer was created, and is a bit stale now.
    – J Trana
    Oct 30, 2015 at 23:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.