Showdown: [Feature request] - Reverse convert

Created on 7 May 2017  路  8Comments  路  Source: showdownjs/showdown

For e.g <h1 id="hellomarkdown">hello, markdown!</h1>
Will return back # Hello markdown

pending request

Most helpful comment

Markdown is useful because it leaves the formatting/display up to the client. Example - you may be converting markdown to richtext to display within a mobile app, instead of displaying it as HTML as you would in a web app.

So a use case might be that you use a WYSIWYG editor to create HTML content via a web app. The content is then reverse converted to markdown and stored in the DB. When consumed/viewed, the same content is then either converted to HTML for display on web, or richtext for display in a mobile app (etc).

All 8 comments

What is the use case of this?

Markdown is useful because it leaves the formatting/display up to the client. Example - you may be converting markdown to richtext to display within a mobile app, instead of displaying it as HTML as you would in a web app.

So a use case might be that you use a WYSIWYG editor to create HTML content via a web app. The content is then reverse converted to markdown and stored in the DB. When consumed/viewed, the same content is then either converted to HTML for display on web, or richtext for display in a mobile app (etc).

Check this post in our website:

http://showdownjs.com/#!/blog/annoucement-showdown-2.0

Was this already implemented and just hard to find? The repo description seems to indicate this functionality exists:

A bidirectional MD to HTML to MD converter written in Javascript

I just found it in tests. converter.makeMarkdown()

@tivie Is 2.0 out yet or when will it be? @OrkhanAlikhanov did you find that in tests but not available in source code?

converter.makeMarkdown()

Thanks

@jrmcdona It's available in master branch. See makeMarkdown

233

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ifeltsweet picture ifeltsweet  路  6Comments

BusyHe picture BusyHe  路  4Comments

Ehesp picture Ehesp  路  3Comments

KirkMunro picture KirkMunro  路  6Comments

LeahPike picture LeahPike  路  5Comments