showdown icon indicating copy to clipboard operation
showdown copied to clipboard

[Question] Showdown in Typescript

Open penfold opened this issue 2 years ago • 4 comments

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

Kind Regards, Paul

penfold avatar Jan 19 '22 16:01 penfold

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

SyntaxRules avatar Feb 10 '22 15:02 SyntaxRules

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

tivie avatar Feb 21 '22 19:02 tivie

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>

thdoan avatar Jan 24 '23 04:01 thdoan

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>

alexpopovme avatar Feb 13 '23 11:02 alexpopovme