aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2012-08-24 11:10:21 +0200
committerLukas Larsson <[email protected]>2012-08-30 15:37:30 +0200
commit74dc5ada9156ed1dd8bb73d6b298b2cdcf3cf3dc (patch)
treeaa4b814c2de243fec97cc65617fade25ef77b429 /lib
parent0e5190b8970e6514da9100f5664284c786dee6a2 (diff)
downloadotp-74dc5ada9156ed1dd8bb73d6b298b2cdcf3cf3dc.tar.gz
otp-74dc5ada9156ed1dd8bb73d6b298b2cdcf3cf3dc.tar.bz2
otp-74dc5ada9156ed1dd8bb73d6b298b2cdcf3cf3dc.zip
Generate <a name="name"> tags in edoc xml headings
Diffstat (limited to 'lib')
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index 20daae8215..cbaa93a15d 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -338,7 +338,7 @@ 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_only(E#xmlElement.content),
+ Content = text_and_a_name_only(E#xmlElement.content),
[E#xmlElement{name=b, content=Content}];
otp_xmlify_e(#xmlElement{name=Tag} = E) % 5b-c)
when Tag==center;
@@ -1161,6 +1161,18 @@ 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_only(Es) -> Ts
%% Takes a list of xmlElement and xmlText and return a lists of xmlText.
text_only([#xmlElement{content = Content}|Es]) ->