@@ -207,6 +207,8 @@ ignoreBlank = ignoreElem test
207207 | otherwise -> False
208208
209209-- | Returns name of current element.
210+--
211+-- @since 1.0.0
210212getCurrentName :: (Monad m) => DomParserT Identity m Text
211213getCurrentName = view $ pdElements . to runIdentity . localName
212214
@@ -227,6 +229,8 @@ checkCurrentName n = do
227229
228230-- | Get current content. If current element contains no content or
229231-- have inner elements then Nothing returned
232+--
233+-- @since 1.0.0
230234getCurrentContent :: (Monad m) => DomParserT Identity m (Maybe Text)
231235getCurrentContent = do
232236 nds <- view $ pdElements . to runIdentity . nodes
@@ -254,6 +258,10 @@ parseContent parse = getCurrentContent >>= \case
254258 Left e -> throwParserError $ PEWrongFormat e
255259 Right a -> return a
256260
261+-- | If reader returns 'Nothing' then resulting function returns 'Left
262+-- "error message"'
263+--
264+-- @since 1.0.0
257265maybeReadContent
258266 :: forall a
259267 . (Typeable a)
@@ -275,9 +283,15 @@ readContent
275283 -> Either Text a
276284readContent = maybeReadContent $ readMaybe . T.unpack . T.strip
277285
286+-- | Retuns map of attributes of current element
287+--
288+-- @since 1.0.0
278289getCurrentAttributes :: (Monad m) => DomParserT Identity m (M.Map Name Text)
279290getCurrentAttributes = view $ pdElements . to runIdentity . attrs
280291
292+-- | Returns element with given name or 'Nothing'
293+--
294+-- @since 1.0.0
281295getCurrentAttribute :: (Monad m) => Text -> DomParserT Identity m (Maybe Text)
282296getCurrentAttribute attrName'
283297 = preview $ pdElements . to runIdentity . attr attrName
@@ -285,6 +299,8 @@ getCurrentAttribute attrName'
285299 attrName = Name attrName' Nothing Nothing
286300
287301-- | Parses attribute with given name, throws error if attribute is not found.
302+--
303+-- @since 1.0.0
288304parseAttribute
289305 :: (Monad m)
290306 => Text