portal.processHtmlΒΆ

This command replaces abstract internal links contained in an HTML text by generated URLs.

Argument:

value (string)
Html value string to process.

Example use in controller:

var processedHtml = execute('portal.processHtml', {
  value: '<a href="content://123" target="">Content</a>' +
         '<a href="media://inline/123" target="">Inline</a>' +
         '<a href="media://download/123" target="">Download</a>'
});

Result:

<a href="/admin/portal/preview/draft/features/content" target="">Content</a>
<a href="/admin/portal/preview/draft/features/content/_/attachment/inline/123/image.jpg" target="">Inline</a>
<a href="/admin/portal/preview/draft/features/content/_/attachment/download/123/image.jpg" target="">Download</a>