How to use the ngx-markdown.MarkedRenderer function in ngx-markdown

To help you get started, we’ve selected a few ngx-markdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github devconcept / ng-shopping-cart / docs / base-package / site / app / markdown-factory.ts View on Github external
export function markedOptionsFactory(router: Router): MarkedOptions {
  const renderer = new MarkedRenderer();

  renderer.blockquote = (quote: string) => {
    return `<blockquote class="note default">${quote}</blockquote>`
  };

  renderer.heading = (text: string, level: number) =&gt; {
    const escapedText = text.toLowerCase()
      .replace(/[^\w():]+/g, '-')
      .replace(/-code-/g, '-')
      .replace(/-strong-/g, '')
      .replace(/-$/, '')
      .replace(/^-/, '')
      .replace(/\([a-zA-Z: ]*\)$/, '');

    const currentUrl = router.routerState.snapshot.url.split('#')[0].substr(1);
    return level &gt;= 4
github jfcere / ngx-markdown / demo / src / app / app.module.ts View on Github external
export function markedOptions(): MarkedOptions {
  const renderer = new MarkedRenderer();

  renderer.blockquote = (text: string) =&gt; {
    return '<blockquote class="blockquote"><p>' + text + '</p></blockquote>';
  };

  return {
    renderer: renderer,
    gfm: true,
    tables: true,
    breaks: false,
    pedantic: false,
    sanitize: false,
    smartLists: true,
    smartypants: false,
  };
}
github ghiscoding / angular-markdown-editor / src / app / app.module.ts View on Github external
useFactory: (): MarkedOptions => {
        return {
          renderer: new MarkedRenderer(),
          gfm: true,
          tables: true,
          breaks: false,
          pedantic: false,
          sanitize: false,
          smartLists: true,
          smartypants: false,
        };
      },
    }),

ngx-markdown

Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights

MIT
Latest version published 1 day ago

Package Health Score

83 / 100
Full package analysis