Meeseeks.own_text

You're seeing just the function own_text, go back to Meeseeks module for more information.
Link to this function

own_text(extractable, opts \\ [])

View Source

Specs

own_text(extractable(), Keyword.t()) :: String.t() | nil

Returns the combined text of a result or the result's children, which may be an empty string.

Once the text has been combined the whitespace is compacted by replacing all instances of more than one whitespace character with a single space and then trimmed.

Nil input returns nil.

Options

  • :collapse_whitespace - Boolean determining whether or not to replace blocks of whitespace with a single space character. Defaults to true.
  • :trim - Boolean determining whether or not to trim the resulting text. Defaults to true.

Examples

iex> import Meeseeks.CSS
iex> result = Meeseeks.one("<div>Hello, <b>World!</b></div>", css("div"))
#Meeseeks.Result<{ <div>Hello, <b>World!</b></div> }>
iex> Meeseeks.own_text(result)
"Hello,"