@federicocarboni/saxe
    Preparing search index...

    Interface EntityProvider

    interface EntityProvider {
        getEntity(name: string): string | undefined;
    }
    Index

    Methods

    Methods

    • Returns the replacement text of an external entity or an entity declared in external markup declarations. Returns undefined for entity names with no declaration.

      Note that replacement text is not treated as literal plain text, it is parsed as markup, so it may contain elements, character references, or even other entity references.

      If the entity value should be treated as literal plain text it should be escaped with xmlEscape before returning it.

      getEntity(name) {
      if (name === "foo") {
      // Parsed as start tag 'bar', entity ref 'baz', end tag 'bar'
      return "<bar>&baz;</bar>";
      }
      if (name === "boo") {
      // Parsed as the literal text '<bar>&baz;</bar>'
      return xmlEscape("<bar>&baz;</bar>");
      }
      return undefined;
      }

      Parameters

      • name: string

        Name of the entity.

      Returns string | undefined

      • Returns the replacement text of the specified entity.