View Source
Class HtmlImageSourceParser
Inheritance
System.Object
Assembly: Umbraco.Web.dll
Syntax
public sealed class HtmlImageSourceParser
Constructors
View Source
HtmlImageSourceParser(Func<Guid, String>)
Declaration
public HtmlImageSourceParser(Func<Guid, string> getMediaUrl)
Parameters
Type |
Name |
Description |
System.Func<System.Guid, System.String> |
getMediaUrl |
|
View Source
HtmlImageSourceParser(IUmbracoContextAccessor)
Declaration
public HtmlImageSourceParser(IUmbracoContextAccessor umbracoContextAccessor)
Parameters
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 |
|
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 |
System.Collections.Generic.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 |
|