showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.26k stars 1.56k forks source link

[Question] Showdown in Typescript #883

Open penfold opened 2 years ago

penfold commented 2 years ago

Have you considered moving to use Typescript for v2.0?

Kind Regards, Paul

SyntaxRules commented 2 years ago

Typescript would be great- its quite a large change, so help will be needed.

tivie commented 2 years ago

That would be a really HUGE undertaking, since showdown uses some prototyping and weak typing that would be hard to replicate in pure typescript.

thdoan commented 1 year ago

Here's how I'm using Showdown in my TypeScript Svelte app...

shell

npm install --save showdown @types/showdown

Component.svelte

<script lang="ts">
import showdown from 'showdown';

const converter = new showdown.Converter();
const html = converter.makeHtml(someMarkdownContent);
</script>
alexpopovme commented 1 year ago

My variant in Vue app npm install --save showdown @types/showdown

<script lang="ts">
import { Converter } from 'showdown';

const converter = new Converter();
const html = converter.makeHtml(someMarkdownContent);
</script>