Markdown Element
HTML Element for markdown content.
Usage:
<body>
<script src="https://cdn.jsdelivr.net/npm/markdown-element@latest/dist/markdown-elements.min.js"></script>
<mark-down>
## h2
* test
* test2
```javascript
let x = 'asdf'
class Text {
constructor() {
}
}
```
</mark-down>
</body>
Attributes
The following element attributes can be used to change the render settings.
- gfm: defaults to true. Enable GitHub flavored markdown.
- tables: defaults to true. Enable GFM tables. This option requires the gfm option to be true.
- breaks: defaults to false. Enable GFM line breaks. This option requires the gfm option to be true.
- highlight: defaults to true. Enables syntax highlighting.
- pedantic: defaults to false. Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
- smartLists: defaults to true. Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
- smartypants: defaults to false. Use "smart" typograhic punctuation for things like quotes and dashes.
Example:
<mark-down pedantic=true>
# h1
* test
</mark-down>
Bundling
If you want to build the component into the JavaScript bundle of your app
you can do so easily, but you'll need to handle loading a WebComponents
polyfill on your own.