0 | module Cheerio.Manipulation
 1 |
 2 | import Cheerio.Data
 3 | import Cheerio.Utils
 4 |
 5 | -- text
 6 |
 7 | %foreign "node:lambda: cheerio => cheerio.text()"
 8 | prim_text : Cheerio -> PrimIO String
 9 |
10 | export
11 | text : HasIO io => Cheerio -> io String
12 | text cheerio = primIO $ prim_text cheerio
13 |
14 | -- html
15 |
16 | %foreign "node:lambda: (primToMaybe, cheerio) => primToMaybe(cheerio.text())"
17 | prim_html : (String -> Maybe String) -> Cheerio -> PrimIO (Maybe String)
18 |
19 | export
20 | html : HasIO io => Cheerio -> io (Maybe String)
21 | html cheerio = primIO $ prim_html primToMaybe cheerio
22 |