module Asciidoctor::Helpers

def encode_spaces_in_uri str

Returns the specified String with all spaces replaced with %20.

str - the String to encode

Internal: Apply URI path encoding to spaces in the specified string (i.e., convert spaces to %20).
def encode_spaces_in_uri str
  (str.include? ' ') ? (str.gsub ' ', '%20') : str
end