8.22.0 • Published 4 months ago

@covalent/markdown v8.22.0

Weekly downloads
1,057
License
MIT
Repository
github
Last release
4 months ago

TdMarkdownComponent: td-markdown

<td-markdown> is a component that parses and renders Github flavored markdown. It is based on the showdown library.

Note: This module uses the DomSanitizer service to sanitize the parsed html from the showdown lib to avoid XSS issues.

By default, --dev build will log the following message in the console to let you know:

WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).

API Summary

Inputs

  • content?: string

    • Markdown format content to be parsed as html markup.
    • Used to load data dynamically. e.g. README.md content.
  • simpleLineBreaks?: string

    • Sets whether newline characters inside paragraphs and spans are parsed as .
    • Defaults to false.
  • hostedUrl?: string

    • If markdown contains relative paths, this is required to generate correct urls.
  • anchor?: string

    • Anchor to jump to.
  • fileLinkExtensions?: string[]

    • The file extensions to monitor within anchor tags.
    • Clicking links that end with these extensions will prevent the default action and emit 'fileClicked' event.

Events

  • contentReady: undefined

    • Event emitted after the markdown content rendering is finished.
  • fileLinkClicked: URL

    • Emitted when an anchor tag is clicked and its 'href' matches one of the extensions in 'fileLinkExtensions'.

Installation

This component can be installed as an npm package.

npm i -save @covalent/markdown

Setup

Then, import the CovalentMarkdownModule in your NgModule:

import { CovalentMarkdownModule } from '@covalent/markdown';
@NgModule({
  imports: [
    CovalentMarkdownModule,
    ...
  ],
  ...
})
export class MyModule {}

Theming

This module comes with its own Covalent theme which uses the material theme which is used by importing our theme scss file.

@use '@angular/material/theming' as mat;
@use '@covalent/markdown/markdown-theme' as markdown;

@include mat.core();

$primary: mat.define-palette($mat-orange, 800);
$accent: mat.define-palette($mat-light-blue, 600, A100, A400);
$warn: mat.define-palette($mat-red, 600);

$theme: mat.define-light-theme($primary, $accent, $warn);

@include markdown.covalent-markdown-theme($theme);

Example

Html:

<td-markdown> # Heading ## Sub Heading (H2) ### Steps (H2) </td-markdown>

Output:

Heading

Sub Heading (H2)

Steps (H2)

8.22.0

4 months ago

8.21.2

4 months ago

8.21.1

5 months ago

8.21.0

5 months ago

8.20.2

6 months ago

8.20.3

6 months ago

8.20.4

6 months ago

8.20.5

6 months ago

8.20.6

6 months ago

8.20.7

6 months ago

8.20.8

6 months ago

8.19.1

6 months ago

8.19.0

6 months ago

8.12.2

9 months ago

8.12.3

9 months ago

8.13.0

9 months ago

8.14.0

9 months ago

8.14.2

8 months ago

8.14.1

8 months ago

8.14.4

7 months ago

8.14.3

7 months ago

8.15.0-beta.13

7 months ago

8.15.0-beta.12

7 months ago

8.15.0-beta.11

7 months ago

8.15.0-beta.10

8 months ago

8.15.0

7 months ago

8.15.0-beta.17

7 months ago

8.15.0-beta.16

7 months ago

8.15.0-beta.15

7 months ago

8.15.0-beta.14

7 months ago

4.17.3

7 months ago

4.17.4

7 months ago

4.17.0

7 months ago

4.17.1

7 months ago

8.16.0

7 months ago

8.16.1

7 months ago

8.17.1

7 months ago

8.17.0

7 months ago

8.20.0

6 months ago

8.20.1

6 months ago

8.15.0-beta.4

8 months ago

8.15.0-beta.3

8 months ago

8.15.0-beta.2

8 months ago

8.15.0-beta.1

8 months ago

8.15.0-beta.8

8 months ago

8.15.0-beta.7

8 months ago

8.15.0-beta.6

8 months ago

8.15.0-beta.5

8 months ago

8.15.0-beta.9

8 months ago

8.18.0

7 months ago

8.18.1

7 months ago

8.12.1

10 months ago

8.11.0

10 months ago

8.12.0

10 months ago

8.10.0

11 months ago

8.10.1

11 months ago

8.9.2

11 months ago

8.9.1

11 months ago

8.9.0

11 months ago

8.8.1

11 months ago

8.8.0

11 months ago

8.8.0-beta.1

11 months ago

8.7.0

11 months ago

8.6.1

12 months ago

8.6.0-beta.1

12 months ago

8.5.4

12 months ago

8.5.5

12 months ago

8.7.0-beta.9

12 months ago

8.7.0-beta.8

12 months ago

8.7.0-beta.7

12 months ago

8.7.0-beta.6

12 months ago

8.7.0-beta.5

12 months ago

8.7.0-beta.4

12 months ago

8.6.0

12 months ago

8.7.0-beta.3

12 months ago

8.7.0-beta.2

12 months ago

8.7.0-beta.1

12 months ago

8.5.3

12 months ago

8.5.2

12 months ago

8.5.1

12 months ago

8.4.0

12 months ago

8.5.0

12 months ago

8.3.1

1 year ago

8.4.0-beta.3

1 year ago

8.4.0-beta.2

1 year ago

8.4.0-beta.1

1 year ago

8.3.0

1 year ago

8.3.0-beta.3

1 year ago

8.3.0-beta.2

1 year ago

8.2.1

1 year ago

8.3.0-beta.1

1 year ago

8.2.0-beta.1

1 year ago

8.2.0

1 year ago

8.1.0

1 year ago

8.1.0-beta.9

1 year ago

8.1.0-beta.8

1 year ago

8.1.0-beta.7

1 year ago

8.1.0-beta.6

1 year ago

8.1.0-beta.5

1 year ago

8.1.0-beta.4

1 year ago

8.1.0-beta.3

1 year ago

8.1.0-beta.2

1 year ago

8.1.0-beta.1

1 year ago

7.5.0-beta.4

1 year ago

7.5.0-beta.5

1 year ago

8.0.0

1 year ago

7.4.7

1 year ago

7.4.6

1 year ago

7.4.5

1 year ago

7.4.4

1 year ago

7.4.3

1 year ago

7.5.0-beta.3

1 year ago

6.1.2

2 years ago

6.1.3

2 years ago

7.3.1

1 year ago

7.3.0

1 year ago

7.4.2

1 year ago

7.4.1

1 year ago

7.5.0-beta.2

1 year ago

7.5.0-beta.1

1 year ago

6.2.1

2 years ago

6.2.0

2 years ago

6.2.3

2 years ago

6.2.2

2 years ago

7.4.0-beta.1

1 year ago

7.4.0-beta.2

1 year ago

7.0.0

2 years ago

7.4.0

1 year ago

4.16.3

1 year ago

4.16.0

2 years ago

4.16.1

2 years ago

4.16.2

2 years ago

6.3.0

2 years ago

7.1.0-beta.2

1 year ago

7.1.0-beta.1

1 year ago

7.1.0-beta.3

1 year ago

7.1.1

1 year ago

7.1.0

1 year ago

6.4.0

2 years ago

6.3.0-beta.1

2 years ago

6.3.0-beta.2

2 years ago

6.3.0-beta.3

2 years ago

6.3.0-beta.4

2 years ago

7.2.0

1 year ago

6.1.0

2 years ago

6.1.1

2 years ago

6.0.0-beta.1

2 years ago

6.0.0-beta.2

2 years ago

5.1.0-beta.1

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.5

2 years ago

6.0.4

2 years ago

5.0.2

2 years ago

5.0.0-beta.1

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.16.0-beta.2

2 years ago

4.16.0-beta.1

2 years ago

4.10.2

2 years ago

4.14.0

2 years ago

4.13.0

2 years ago

4.12.3

2 years ago

4.12.0

2 years ago

4.12.1

2 years ago

4.12.2

2 years ago

4.15.0

2 years ago

4.11.0

2 years ago

4.8.0

2 years ago

4.7.0

2 years ago

4.7.1

2 years ago

4.6.1

2 years ago

4.6.0

2 years ago

4.6.2

2 years ago

4.5.0

3 years ago

4.4.0

3 years ago

3.2.2

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.2.4

3 years ago

3.2.3

3 years ago

4.3.0

3 years ago

4.2.1

3 years ago

4.1.9

3 years ago

4.1.11-develop.1

3 years ago

4.2.0

3 years ago

4.1.10

3 years ago

4.1.11

3 years ago

4.1.12

3 years ago

4.1.13

3 years ago

4.1.14

3 years ago

4.1.15

3 years ago

4.1.8

3 years ago

4.1.7

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.6

3 years ago

4.1.5

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

4.1.1-develop.1

3 years ago

4.1.0-develop.5

3 years ago

4.1.0-develop.6

3 years ago

4.1.0-develop.7

3 years ago

4.1.0-develop.8

3 years ago

4.1.0-develop.9

3 years ago

4.1.0-develop.2

3 years ago

4.1.0-develop.4

3 years ago

4.1.0-develop.11

3 years ago

4.1.0-develop.10

3 years ago

4.1.0

3 years ago

4.0.0-beta.5

3 years ago

4.1.1-beta.3

3 years ago

4.1.1-next.1

3 years ago

4.0.0-beta.4

3 years ago

4.0.0-beta.2

3 years ago

0.0.1

3 years ago

4.0.0-alpha.0

3 years ago

4.0.0

3 years ago

3.1.2-beta.7

3 years ago

3.1.2

3 years ago

4.0.0-beta.1

3 years ago

3.1.2-beta.6

3 years ago

3.1.2-beta.4

3 years ago

3.1.1

4 years ago

3.1.1-beta.1

4 years ago

3.1.0

4 years ago

3.1.0-beta.2

4 years ago

3.0.1

5 years ago

3.1.0-beta.1

5 years ago

3.0.0

5 years ago

3.0.0-rc.2

5 years ago

3.0.0-rc.1

5 years ago

3.0.0-beta.3

5 years ago

3.0.0-beta.2

5 years ago

3.0.0-beta.1-2

5 years ago

3.0.0-beta.1-1

5 years ago

3.0.0-beta.1

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

2.0.0-rc.2

6 years ago

2.0.0-rc.1

6 years ago

2.0.0-beta.5

6 years ago

2.0.0-beta.4

6 years ago

2.0.0-beta.3

7 years ago

2.0.0-beta.2

7 years ago

1.0.1

7 years ago

2.0.0-beta.1

7 years ago

1.0.0

7 years ago

1.0.0-rc.5

7 years ago

1.0.0-rc.4

7 years ago

1.0.0-rc.3

7 years ago

1.0.0-rc.2

7 years ago

1.0.0-rc.1

7 years ago

1.0.0-rc.0

7 years ago

1.0.0-beta.8-1

7 years ago

1.0.0-beta.8

7 years ago

1.0.0-beta.7

7 years ago

1.0.0-beta.6

8 years ago

1.0.0-beta.5-1

8 years ago

1.0.0-beta.5

8 years ago

1.0.0-beta.4

8 years ago

1.0.0-beta.3-2

8 years ago

1.0.0-beta.3-1

8 years ago

1.0.0-beta.3

8 years ago

1.0.0-beta.2-1

8 years ago

1.0.0-beta.2

8 years ago

1.0.0-beta.1-1

8 years ago

1.0.0-beta.1

8 years ago

0.10.2

8 years ago

0.10.1

8 years ago

0.10.0

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0-exp1

8 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0-1

9 years ago

0.4.0

9 years ago