@patternfly/pfe-markdown

1.12.3 • Public • Published

PatternFly Element | Markdown Element

Use this element to take markdown and have it display as HTML. This element uses the marked.js library to convert the markdown to HTML.

Usage

<pfe-markdown>
  <div pfe-markdown-container># This is a heading</div>
</pfe-markdown>

It is important that the div with the pfe-markdown-container attribute is present. Without it, the element won't work. This element does not actually use the shadow DOM to display it's contents.

At runtime, a child div with an attribute of pfe-markdown-render is appended to the light DOM and the pfe-markdown-container div is hidden with an inline style. The purpose behind this is so that all of the styles that are present in the light DOM are available to the converted markdown.

Slots

There is a default slot but it is just used to capture the light DOM and hide it.

Attributes

None.

Test

npm run test

Build

npm run build

Demo

From the PFElements root directory, run:

npm start

Code style

Accordion (and all PFElements) use Prettier to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can integrate your editor with Prettier to have the style rules applied on every save.

Readme

Keywords

none

Package Sidebar

Install

npm i @patternfly/pfe-markdown

Weekly Downloads

111

Version

1.12.3

License

MIT

Unpacked Size

742 kB

Total Files

14

Last publish

Collaborators

  • bennyp
  • dlabaj
  • ausuliv
  • dgutride
  • dlabrecq
  • patternfly-build
  • jeff-phillips-18
  • mturley
  • mwcz
  • kylebuch8
  • evwilkin
  • schulj12
  • nicolethoen
  • heymp
  • zhawkins