Method: Asciidoctor::AbstractNode#normalize_web_path

Defined in:
lib/asciidoctor/abstract_node.rb

#normalize_web_path(target, start = nil, preserve_uri_target = true) ⇒ String

Normalize the web path using the PathResolver.

See PathResolver#web_path for details about path resolution and encoding.

Parameters:

  • target

    the String target path

  • start (defaults to: nil)

    the String start (i.e, parent) path (optional, default: nil)

  • preserve_uri_target (defaults to: true)

    a Boolean indicating whether target should be preserved if contains a URI (default: true)

Returns:

  • (String)

    Returns the resolved String path



481
482
483
484
485
486
487
# File 'lib/asciidoctor/abstract_node.rb', line 481

def normalize_web_path(target, start = nil, preserve_uri_target = true)
  if preserve_uri_target && (Helpers.uriish? target)
    Helpers.encode_spaces_in_uri target
  else
    @document.path_resolver.web_path target, start
  end
end