View Source Phoenix.WebComponent.Markdown (Phoenix.WebComponent v1.6.3)

Render markdown in to remark-element.

The remark-element supported markdown featrues:

  • github flavor
  • auto highlight code with lowlight.js and auto detect system light/dark themes.
  • charts render by mermaid.js

Link to this section Summary

Functions

Generates a html customElement remark-element to preview markdown.

Link to this section Functions

Generates a html customElement remark-element to preview markdown.

Docs of remark-element (See https://gsmlg-dev.github.io/lit/?path=/story/gsmlg-remark-element--basic).

Useful to ensure that links that change data are not triggered by search engines and other spidering software.

examples

Examples

wc_remark("# Hello", class: "dark")
#=> <remark-element class="dark" content="# Hello"></remark-element>

wc_remark(content: "# Hello", class: "btn")
#=> <remark-element class="btn" content="# Hello"></remark-element>

options

Options

  • :debug - print log in browser console

  • :content - The content of markdown, replace innerHTML.

All other options are forwarded to the underlying button input.