Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] - Reverse convert #388

Assignees
Labels
PR: request-changes This PR needs additional changes

Comments

@haskaalo
Copy link

haskaalo commented May 7, 2017

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

@tivie tivie self-assigned this May 7, 2017
@tivie tivie added the PR: request-changes This PR needs additional changes label May 7, 2017
@tivie tivie added the Pending label Aug 5, 2017
@OrkhanAlikhanov
Copy link

What is the use case of this?

@projectitis
Copy link

projectitis commented Sep 22, 2017

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).

@tivie
Copy link
Member

tivie commented Dec 22, 2017

Check this post in our website:

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

@ryantuck
Copy link

ryantuck commented Aug 7, 2018

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

@OrkhanAlikhanov
Copy link

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

@jrmcdona
Copy link

jrmcdona commented Sep 5, 2018

@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

@OrkhanAlikhanov
Copy link

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

@tivie
Copy link
Member

tivie commented Sep 14, 2018

#233

tivie added a commit that referenced this issue Nov 10, 2018
Showdown now supports a simple HTML to Markdown converter.

**Usage:**

```
var conv = new showdown.Converter();
var md = conv.makeMarkdown('<a href="/url">a link</a>');
```

Closes #388, #233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment