Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MarkedLinksPlugin

A plugin that builds links in markdown texts.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private brackets

brackets: RegExp = /\[\[([^\]]+)\]\]/g

Regular expression for detecting bracket links.

componentName

componentName: string

The name of this component as set by the @Component decorator.

Private inlineTag

inlineTag: RegExp = /(?:\[(.+?)\])?\{@(link|linkcode|linkplain)\s+((?:.|\n)+?)\}/gi

Regular expression for detecting inline tags like {@link ...}.

listInvalidSymbolLinks

listInvalidSymbolLinks: boolean

Protected project

The project that is currently processed.

Protected reflection

The reflection that is currently processed.

Protected urlPrefix

urlPrefix: RegExp = /^(http|ftp)s?:\/\//

Regular expression to test if a string looks like an external url.

Private warnings

warnings: string[] = []

Accessors

application

owner

Methods

Protected bubble

Private buildLink

  • buildLink(original: string, target: string, caption: string, monospace?: boolean): string
  • Format a link with the given text and target.

    Parameters

    • original: string

      The original link string, will be returned if the target cannot be resolved..

    • target: string

      The link target.

    • caption: string

      The caption of the link.

    • Optional monospace: boolean

      Whether to use monospace formatting or not.

    Returns string

    A html link tag.

getOptionDeclarations

getRelativeUrl

  • getRelativeUrl(absolute: string): string

initialize

  • initialize(): void

listenTo

listenToOnce

off

  • off(): any
  • off(eventMap: EventMap, context?: any): any
  • off(name: string, callback?: EventCallback, context?: any): any

on

  • on(eventMap: EventMap, context?: any): any
  • on(eventMap: EventMap, callback?: EventCallback, context?: any, priority?: number): any
  • on(name: string, callback: EventCallback, context?: any, priority?: number): any

Protected onBeginPage

Protected onBeginRenderer

onEndRenderer

onParseMarkdown

once

  • once(eventMap: EventMap, context?: any): any
  • once(name: string, callback: EventCallback, context?: any, priority?: any): any
  • Bind an event to only be triggered a single time. After the first time the callback is invoked, its listener will be removed. If multiple events are passed in using the space-separated syntax, the handler will fire once for each event, not once for a combination of all events.

    Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns any

  • Parameters

    • name: string
    • callback: EventCallback
    • Optional context: any
    • Optional priority: any

    Returns any

Private replaceBrackets

  • replaceBrackets(text: string): string
  • Find all references to symbols within the given text and transform them into a link.

    This function is aware of the current context and will try to find the symbol within the current reflection. It will walk up the reflection chain till the symbol is found or the root reflection is reached. As a last resort the function will search the entire project for the given symbol.

    Parameters

    • text: string

      The text that should be parsed.

    Returns string

    The text with symbol references replaced by links.

Private replaceInlineTags

  • replaceInlineTags(text: string): string
  • Find symbol {@link ...} strings in text and turn into html links

    Parameters

    • text: string

      The string in which to replace the inline tags.

    Returns string

    The updated string.

stopListening

trigger

  • Trigger one or many events, firing all bound callbacks. Callbacks are passed the same arguments as trigger is, apart from the event name (unless you're listening on "all", which will cause your callback to receive the true name of the event as the first argument).

    Parameters

    Returns this

Static splitLinkText

  • splitLinkText(text: string): object
  • Split the given link into text and target at first pipe or space.

    Parameters

    • text: string

      The source string that should be checked for a split character.

    Returns object

    An object containing the link text and target.

    • caption: string
    • target: string

Generated using TypeDoc