How to use the octicons.link function in octicons

To help you get started, we’ve selected a few octicons 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
renderer.heading = (text: string, level: number) => {
    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 >= 4
      ? `
        <a href="${currentUrl}#${escapedText}" class="header" id="${escapedText}">
          
            ${octicons.link.toSVG()}
            ${text}
           
        </a>
        `
      : `
        
          ${text}
        
      `;
  };