markdown-element

by mikeal

HTML Element that renders markdown content.

129 Stars 15 Forks Last release: almost 3 years ago (v2.0.2) 20 Commits 11 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Markdown Element

HTML Element for markdown content.

Usage:

  
  
    ## h2

* test
  * test2

```javascript
let x = 'asdf'

class Text {
  constructor() {

  }
}
```

Attributes/properties

The following element properties can be used to change the render settings. They can be set either from JavaScript or from HTML.

  • noGFM: Disables GitHub flavored markdown (GFM).
  • noTables: Disables GFM tables. This has no effect if
    noGFM
    is true.
  • breaks: Enable GFM line breaks. This has no effect if
    noGFM
    is true.
  • noHighlight: Disables syntax highlighting.
  • pedantic: Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
  • noSmartLists: Disable smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
  • smartyPants: Use "smart" typographic punctuation for things like quotes and dashes.

Examples:

    # h1

* test
let marked = document.createElement('mark-down')
marked.noGFM = true
marked.smartyPants = true
document.body.appendChild(marked)

Rendering

The rendered markdown is placed in a

 element.
  
    

h1

  • test

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.