diff options
author | Lars Thorsen <[email protected]> | 2015-12-04 12:56:09 +0100 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2015-12-04 12:56:09 +0100 |
commit | f86828fead59ba0a28658d3f5e7d8dc80f1c73fb (patch) | |
tree | 234beceeb9dbb3dae9750703f02bd0450d192d53 /lib/erl_docgen/src/docgen_edoc_xml_cb.erl | |
parent | 7a13283ac6f4a7738dbe2a2ccfce392a820dca2a (diff) | |
parent | 03dfbda168896807c75bd396262a3de060a91b13 (diff) | |
download | otp-f86828fead59ba0a28658d3f5e7d8dc80f1c73fb.tar.gz otp-f86828fead59ba0a28658d3f5e7d8dc80f1c73fb.tar.bz2 otp-f86828fead59ba0a28658d3f5e7d8dc80f1c73fb.zip |
Merge branch 'lars/xmllint-incorrect-errors/OTP-13026' into maint
* lars/xmllint-incorrect-errors/OTP-13026:
[erl_docgen] Allow br in the tag of tagged lists
[erl_docgen] Add conversion of the i tag in the XSL specs
[erl_docgen] Correct DTD for tags anno, fsummary and add an tag i (italic).
[erl_docgen] Correct faults in the dtd
Change xmllint target
[erl_docgen] Update DTD for anno tag
Diffstat (limited to 'lib/erl_docgen/src/docgen_edoc_xml_cb.erl')
-rw-r--r-- | lib/erl_docgen/src/docgen_edoc_xml_cb.erl | 24 |
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. |