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

How can I render the markdown in browser,may be a bug #451

Closed
ghost opened this issue May 13, 2017 · 0 comments · Fixed by #548
Closed

How can I render the markdown in browser,may be a bug #451

ghost opened this issue May 13, 2017 · 0 comments · Fixed by #548

Comments

@ghost
Copy link

ghost commented May 13, 2017

Firstly I test this code in node

const github = require('github-api');

const gh = new github({
    username: "**********",
    password: "**********"
});
const markdown = gh.getMarkdown();
var options = {
    text: '# Hello world!'
};

markdown.render(options).then(function({data:html}) {
    console.log(html)
});

So I get flowing string.

<h1>
<a id="user-content-hello-world" class="anchor" href="#hello-world" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Hello world!</h1>

But when I run this code in browser

<script src="GitHub.bundle.js"></script>
<script>
    const gh = new GitHub({
        username: "**********",
        password: "**********"
    });
    const markdown = gh.getMarkdown();
    var options = {
        text: '# Hello world!'
    };

    markdown.render(options).then(function({data:html}) {
        console.log(html)
    });
</script>

I get a null,so please help me.......

j-rewerts added a commit to j-rewerts/github that referenced this issue Apr 7, 2019
j-rewerts added a commit to j-rewerts/github that referenced this issue Apr 10, 2019
clayreimann pushed a commit that referenced this issue Apr 17, 2019
Got the code from PR #505.
Fixes #451.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants