Skip to content

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

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions