Skip to content
This repository has been archived by the owner on Aug 28, 2017. It is now read-only.

TF 2.0 #2

Merged
merged 8 commits into from
Aug 1, 2015
Merged

TF 2.0 #2

merged 8 commits into from
Aug 1, 2015

Conversation

rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Aug 1, 2015

It should probably be commonMarkTransform by now, but I digress.

I'll be adding some tests here as well.

It should probably be commonMarkTransform now...
export default class MarkdownTransformer {
constructor() {
this.reader = new commonmark.Parser();
this.writer = new commonmark.HtmlRenderer({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm already missing the fact that these were classes before...

let reader = new commonmark.Parser();
let writer = new commonmark.HtmlRenderer({
safe: true
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to wrap this in a closure so it's not creating the reader and writer everytime...

@rgbkrk
Copy link
Member Author

rgbkrk commented Aug 1, 2015

/cc @jdfreder @willwhitney

@rgbkrk
Copy link
Member Author

rgbkrk commented Aug 1, 2015

💥 now I can have closure

@rgbkrk
Copy link
Member Author

rgbkrk commented Aug 1, 2015

Usage:

> text = '```bash\nnpm install transformime-commonmark\n```\n';
> el = markdownTransform('text/markdown', text, document);
> el.innerHTML
'<pre><code class="language-bash">npm install transformime-commonmark\n</code></pre>\n'

willwhitney added a commit that referenced this pull request Aug 1, 2015
@willwhitney willwhitney merged commit 3f7c993 into master Aug 1, 2015
@rgbkrk rgbkrk deleted the TF2.0 branch August 1, 2015 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants