Skip to content

What am I doing wrong with github flavor? #9

@jcs090218

Description

@jcs090218

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions