Search Results for

    Show / Hide Table of Contents
    View Source

    Class HtmlUrlParser

    Utility class used to parse and resolve relative URLs in HTML content.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Templates
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class HtmlUrlParser

    Constructors

    View Source

    HtmlUrlParser(IOptionsMonitor<ContentSettings>, ILogger<HtmlUrlParser>, IProfilingLogger, IIOHelper)

    Initializes a new instance of the HtmlUrlParser class.

    Declaration
    public HtmlUrlParser(IOptionsMonitor<ContentSettings> contentSettings, ILogger<HtmlUrlParser> logger, IProfilingLogger profilingLogger, IIOHelper ioHelper)
    Parameters
    Type Name Description
    IOptionsMonitor<ContentSettings> contentSettings

    The content settings options monitor.

    ILogger<HtmlUrlParser> logger

    The logger instance.

    IProfilingLogger profilingLogger

    The profiling logger instance.

    IIOHelper ioHelper

    The IO helper for resolving URLs.

    Methods

    View Source

    EnsureUrls(string)

    The RegEx matches any HTML attribute values that start with a tilde (~), those that match are passed to ResolveUrl to replace the tilde with the application path.

    Declaration
    public string EnsureUrls(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    string
    Remarks

    When used with a Virtual-Directory set-up, this would resolve all URLs correctly. The recommendation is that the "ResolveUrlsFromTextString" option (in umbracoSettings.config) is set to false for non-Virtual-Directory installs.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX