Created
April 19, 2011 10:37
-
-
Save vlm/927107 to your computer and use it in GitHub Desktop.
Erlang inteview question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Given the parsed HTML tree in the following format: | |
%% | |
%% Types HTML = [Element] | |
%% Element = {Tag, [Attribute], [Element | Text]} | |
%% Tag = atom() % e.g. 'a', 'pre', 'p' | |
%% Attribute = {Name, Value} | |
%% Name = atom() | |
%% Value = string() | |
%% Text = iolist() | |
%% | |
%% Write the function with the following signature: | |
%% | |
%% strip_html(HTML) -> string(). | |
%% | |
%% which strips the HTML formatting and just returns | |
%% the raw text contents of the given HTML tree. | |
example_data() -> {a, [{href, "http://fprog.ru/"}], [{b, [], ["An example text"]}]}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment