Search Results for

    Show / Hide Table of Contents
    View Source

    Class HtmlImageSourceParser

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Templates
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class HtmlImageSourceParser

    Constructors

    View Source

    HtmlImageSourceParser(Func<Guid, String>)

    Declaration
    public HtmlImageSourceParser(Func<Guid, string> getMediaUrl)
    Parameters
    Type Name Description
    Func<Guid, System.String> getMediaUrl
    View Source

    HtmlImageSourceParser(IPublishedUrlProvider)

    Declaration
    public HtmlImageSourceParser(IPublishedUrlProvider publishedUrlProvider)
    Parameters
    Type Name Description
    IPublishedUrlProvider publishedUrlProvider

    Methods

    View Source

    EnsureImageSources(String)

    Parses the string looking for Umbraco image tags and updates them to their up-to-date image sources.

    Declaration
    public string EnsureImageSources(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    System.String
    Remarks

    Umbraco image tags are identified by their data-udi attributes

    View Source

    FindUdisFromDataAttributes(String)

    Parses out media UDIs from an html string based on 'data-udi' html attributes

    Declaration
    public IEnumerable<Udi> FindUdisFromDataAttributes(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    IEnumerable<Udi>
    View Source

    RemoveImageSources(String)

    Removes media URLs from <img> tags where a data-udi attribute is present

    Declaration
    public string RemoveImageSources(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • HtmlImageSourceParser(Func<Guid, String>)
      • HtmlImageSourceParser(IPublishedUrlProvider)
    • Methods
      • EnsureImageSources(String)
      • FindUdisFromDataAttributes(String)
      • RemoveImageSources(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX