@@ -48,7 +48,7 @@ instance Storable Str where
4848foreign import ccall document_parse :: CString -> CInt -> IO (Ptr CDocument)
4949foreign import ccall document_free :: Ptr CDocument -> IO ()
5050foreign import ccall "&document_free" document_free_funptr :: FunPtr (Ptr CDocument -> IO ())
51−foreign import ccall document_render :: Ptr CDocument -> CString -> CInt -> IO CInt
51+foreign import ccall node_render :: Ptr CDocument -> Ptr CNode -> CString -> CInt -> IO CInt
5252foreign import ccall document_error :: Ptr CDocument -> IO CString
5353foreign import ccall document_node :: Ptr CDocument -> IO (Ptr CNode)
5454
@@ -86,8 +86,9 @@ documentParse src = unsafePerformIO $ BS.unsafeUseAsCStringLen (src <> BS.single
8686
8787documentRender :: Document -> BS.ByteString
8888documentRender (Document _ doc) = unsafePerformIO $ withForeignPtr doc $ \d -> do
89− i <- document_render d nullPtr 0
90− BS.create (fromIntegral i) $ \ptr -> void $ document_render d (castPtr ptr) i
89+ n <- document_node d
90+ i <- node_render d n nullPtr 0
91+ BS.create (fromIntegral i) $ \ptr -> void $ node_render d n (castPtr ptr) i
9192
9293
9394documentNode :: Document -> Node