Meeseeks.text
You're seeing just the function
text
, go back to Meeseeks module for more information.
Specs
text(extractable(), Keyword.t()) :: String.t() | nil
Returns the combined text of a result or the result's descendants, 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 totrue
.:trim
- Boolean determining whether or not to trim the resulting text. Defaults totrue
.
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.text(result)
"Hello, World!"