From 1eb67b0e35cb647b61d19eb9f58ed81cc4368576 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 13 Feb 2012 12:06:38 +0100 Subject: Add so that tags will be transformed to --- lib/erl_docgen/src/docgen_edoc_xml_cb.erl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/erl_docgen') diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl index 0971451b32..20daae8215 100644 --- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl +++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl @@ -187,6 +187,7 @@ chapter_title(#xmlElement{content=Es}) -> % name = h3 | h4 %% 8)
contents may need to be made into paragraphs %% 9) (table header) is not allowed - is replaced by %% .... +%% 10) is not allowed, replace with otp_xmlify([]) -> []; otp_xmlify(Es0) -> @@ -416,6 +417,9 @@ otp_xmlify_e(#xmlElement{name=tr} = E) -> otp_xmlify_e(#xmlElement{name=td} = E) -> Content = otp_xmlify_e(E#xmlElement.content), [E#xmlElement{content=Content}]; +otp_xmlify_e(#xmlElement{name=img} = E) -> % 10) + Content = otp_xmlify_e(E#xmlElement.content), + [otp_xmlify_img(E#xmlElement{ content = Content })]; otp_xmlify_e([E | Es]) -> otp_xmlify_e(E) ++ otp_xmlify_e(Es); otp_xmlify_e([]) -> @@ -634,6 +638,20 @@ otp_xmlify_table([#xmlElement{name=td, content=Content}|Es]) -> otp_xmlify_table([]) -> []. +%% otp_xmlify_img(E) -> Es. +%% Transforms a into +otp_xmlify_img(E0) -> + Attrs = lists:map( + fun(#xmlAttribute{ name = src, value = Path} = A) -> + V = otp_xmlify_a_fileref(Path,this), + A#xmlAttribute{ name = file, + value = V }; + (A) -> + A + end,E0#xmlElement.attributes), + E0#xmlElement{name = image, expanded_name = image, + attributes = Attrs}. + %%--Misc help functions used by otp_xmlify/1 et al--------------------- %% find_next(Tag, Es) -> {Es1, Es2} -- cgit v1.2.3