View Source Icon.Parse (Iconic v0.1.2)

Icon parsing module.

Link to this section Summary

Functions

Parse a html string and extract all the icons from it

Link to this section Functions

@spec parse(String.t(), String.t()) :: [Icon.Parse.Icon.t()] | []

Parse a html string and extract all the icons from it

parameters

Parameters

  • html: String
  • url: a URL string

returns

Returns

  • [Icon.Parse.Icon.t()]
  • [] if no icon discovered

examples

Examples

iex> Icon.Parse.parse(-s(<html><head><link rel="icon" href="a/favicon.ico" /></head></html>), "http://test.com")
[%Icon.Parse.Icon{href: "http://test.com/a/favicon.ico", rel: "icon"}]