🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@intcreator/markdown-element

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intcreator/markdown-element

A Markdown renderer that uses the Commonmark spec

0.2.1
Source
npm
Version published
Weekly downloads
38
-47.22%
Maintainers
1
Weekly downloads
 
Created
Source

<markdown-element>

A Markdown renderer that uses the Commonmark spec. This is a replacement for the Polymer sponsored <marked-element>. <marked-element> uses the somewhat outdated Marked parser, while <markdown-element> uses the up to date and better maintained Commonmark parser.

Usage

markdown attribute

The markdown source is taken directly from the markdown attribute supplied to the element. The markdown supplied can be dynamically updated to change the rendered markdown.

    <markdown-element markdown="This **demo** uses the `markdown` _attribute_, not `src`">
        <div slot="markdown-html"></div>
    </markdown-element>

src attribute

The src attribute can be used to load a markdown file through AJAX. It overrides the markdown attribute. The source can be dynamically updated to change the markdown file displayed.

    <markdown-element src="./demo.md">
        <div slot="markdown-html"></div>
    </markdown-element>

<script> tag

A <script> tag can be inserted inside of the <markdown-element> to provide the markdown source. It overrides the markdown and src attributes. Support for changing this markdown source dynamically is not yet implemented.

    <markdown-element>
        <div slot="markdown-html"></div>
        <script type="text/markdown">
            This demo uses a `<script>` tag.
        </script>
    </markdown-element>

Roadmap to 1.0

Here are a few issues that need to be resolved before the 1.0 release:

  • Is it possible to get rid of the <div slot="markdown-html"></div> and still allow users to easily style the contents of <markdown-element> with custom styles?
  • Dynamically update markdown when changed in the script tag (if possible) or find another way to dynamically update multiline-markdown

Contributing

Open an issue or contact me on the Polymer Slack, Twitter, etc. @intcreator.

Keywords

markdown

FAQs

Package last updated on 10 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts