View Source
  Class HtmlImageSourceParser
  
  
  
  
    Inheritance
      System.Object
      
   
  
  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
  
  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 | 
    
    
      
        | 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 |  |