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

What am I doing wrong with github flavor? #9

Open
jcs090218 opened this issue Jan 13, 2020 · 0 comments
Open

What am I doing wrong with github flavor? #9

jcs090218 opened this issue Jan 13, 2020 · 0 comments

Comments

@jcs090218
Copy link

index.html

<!DOCTYPE html>
<html>
<head>
  <title>index</title>
  <meta charset="UTF-8"/>


  <script src="./js/showdown.min.js"></script>
  <script src="./js/showdown-prettify.min.js"></script>
  <script src="./js/main.js"></script>

</head>
<body>


</body>
</html>

main.js

showdown.setFlavor('github');

var converter = new showdown.Converter({extensions: ['prettify']});
var input = "```js\n" +
    "function add(a, b) { console.log(); }\n" +
    "```";
var html = converter.makeHtml(input);
console.log(html);

output

<pre class="prettyprint linenums"><code class="js language-js">function add(a, b) { console.log(); }</code></pre>
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

No branches or pull requests

1 participant