aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen/src
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2015-10-16 12:57:24 +0200
committerLars Thorsen <[email protected]>2015-11-30 08:42:17 +0100
commit39f4c81043c00e2e1284855b07f5181b6ac28841 (patch)
tree1089e8b2952e4aa4cd925e35b10e02f2fcd522b5 /lib/erl_docgen/src
parent166706fbe4b9c32cd3360addfa4428bc06f78380 (diff)
downloadotp-39f4c81043c00e2e1284855b07f5181b6ac28841.tar.gz
otp-39f4c81043c00e2e1284855b07f5181b6ac28841.tar.bz2
otp-39f4c81043c00e2e1284855b07f5181b6ac28841.zip
[erl_docgen] Correct DTD for tags anno, fsummary and add an tag i (italic).
Diffstat (limited to 'lib/erl_docgen/src')
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl24
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index 03fc161c5a..0ac7985a48 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -352,8 +352,8 @@ otp_xmlify_e(#xmlElement{name=code} = E) -> % 4)
end;
otp_xmlify_e(#xmlElement{name=Tag} = E) % 5a
when Tag==h1; Tag==h2; Tag==h3; Tag==h4; Tag==h5 ->
- Content = text_and_a_name_only(E#xmlElement.content),
- [E#xmlElement{name=b, content=Content}];
+ {Name, Text} = text_and_a_name_only(E#xmlElement.content),
+ [Name, E#xmlElement{name=b, content=Text}];
otp_xmlify_e(#xmlElement{name=Tag} = E) % 5b-c)
when Tag==center;
Tag==font ->
@@ -1190,17 +1190,13 @@ get_text(#xmlElement{content=[#xmlText{value=Text}]}) ->
get_text(#xmlElement{content=[E]}) ->
get_text(E).
-%% text_and_name_only(Es) -> Ts
-text_and_a_name_only([#xmlElement{
- name = a,
- attributes = [#xmlAttribute{name=name}]} = Name|Es]) ->
- [Name|text_and_a_name_only(Es)];
-text_and_a_name_only([#xmlElement{content = Content}|Es]) ->
- text_and_a_name_only(Content) ++ text_and_a_name_only(Es);
-text_and_a_name_only([#xmlText{} = E |Es]) ->
- [E | text_and_a_name_only(Es)];
-text_and_a_name_only([]) ->
- [].
+%% text_and_name_only(Es) -> {N, Ts}
+text_and_a_name_only(Es) ->
+ [Name|_] = [Name ||
+ #xmlElement{
+ name = a,
+ attributes = [#xmlAttribute{name=name}]}=Name <- Es],
+ {Name#xmlElement{content = []}, text_only(Es)}.
%% text_only(Es) -> Ts
%% Takes a list of xmlElement and xmlText and return a lists of xmlText.