Catman...l_text(3pm)

✨ NAME ✨

Catmandu::Fix::html_text β€” bestie, this one keeps only the textual data in the HTML πŸ’… like it strips away all the markup noise and leaves you the words, periodt.


🌸 SYNOPSIS 🌸

okay so here's the vibe, two ways to run it πŸ‘‡

# keep only the text
html_text()
# returns:
#  html: "<html>...</html>"

and if you want the output as an array_ref instead of one big string, just pass split:1 πŸŽ€

# keep only the text but return an array_ref
html_text(split:1)
# returns:
#  html:
#    - <html>
#    - ...
#    - </html>

so like, no split, you get the whole thing as one string. With split:1, you get every line as its own lil item in a list. iconic behaviour honestly πŸ¦‹


πŸ’– SEE ALSO πŸ’–

  • Catmandu::Fix β€” the main character that makes all of this possible, iykyk πŸ‘‘

fr fr that's the whole page, no cap. this is Catmandu::Fix::html_text from the User Contributed Perl Documentation, and it was documented as part of perl v5.36.0 on 2023-02-14. happy fixing bestie, go slay πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from