New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

flatmarkdown-ast2angular

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatmarkdown-ast2angular

Render FlatMarkdown AST as native Angular components with routerLink support for wikilinks.

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

flatmarkdown-ast2angular

Render FlatMarkdown AST as native Angular components, with routerLink support for wikilinks.

Installation

npm install flatmarkdown-ast2angular flatmarkdown-ast

Peer dependencies: @angular/core, @angular/common, @angular/router (^21.0.0), flatmarkdown-ast (^0.1.0).

Publish

npm run publish:npm

Usage

Import FmRootComponent in your component:

import { Component } from '@angular/core';
import { FmRootComponent } from 'flatmarkdown-ast2angular';
import type { AstNode } from 'flatmarkdown-ast';

@Component({
  selector: 'app-article',
  standalone: true,
  imports: [FmRootComponent],
  template: `<fm-root [ast]="ast" [options]="options" />`,
})
export class ArticleComponent {
  ast: AstNode = { type: 'document', children: [] };
  options = {
    wikilink: {
      routerLinkPrefix: '/wiki/',
      cssClass: 'wiki-link',
    },
  };
}

FmRootComponent accepts:

  • ast — An AstNode object or a JSON string of the AST.
  • options — Optional AngularRenderOptions.

AngularRenderOptions

interface AngularRenderOptions {
  wikilink?: {
    /** Prefix prepended to the wikilink url for routerLink. Default: '' */
    routerLinkPrefix?: string;
    /** CSS class applied to wikilink anchors. */
    cssClass?: string;
  };
}

Wikilinks are rendered as <a [routerLink]="route" data-wikilink="true"> enabling SPA navigation. All other links use standard <a href>.

License

MIT

Keywords

flatmarkdown

FAQs

Package last updated on 11 Mar 2026

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