Current section

Files

Jump to
html_to_markdown lib html_to_markdown url_escape_style.ex
Raw

lib/html_to_markdown/url_escape_style.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:411256ebae58a5a5ab1b77fe1f91fe158a88eecdc7709575c93a6e4ed499f324
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule HtmlToMarkdown.UrlEscapeStyle do
@moduledoc """
URL encoding strategy for link and image destinations.
Controls how special characters in URL destinations are handled when they
require escaping to produce valid Markdown.
The `Angle` variant (default) wraps the destination in angle brackets:
`[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
but breaks when the URL itself contains `>`.
The `Percent` variant percent-encodes every character that is not an RFC 3986
unreserved character or `/`, producing a destination safe for all Markdown
parsers: `[text](url%20with%20spaces)`.
"""
@typedoc "URL encoding strategy for link and image destinations."
@type t :: :angle | :percent
@angle :angle
@percent :percent
@doc "Wrap destinations that contain spaces or newlines in angle brackets. Default."
@spec angle() :: t()
def angle, do: @angle
@doc "Percent-encode all characters that are not RFC 3986 unreserved or `/`."
@spec percent() :: t()
def percent, do: @percent
end