diff --git a/refpolicy/Changelog b/refpolicy/Changelog index d084d2e..d0929ed 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -1,3 +1,4 @@ + * Fix handling of ordered and unordered HTML lists. * Corenetwork now supports multiple network interfaces having the same type. * Doc tool now creates pages for global Booleans and global tunables. diff --git a/refpolicy/doc/policy.dtd b/refpolicy/doc/policy.dtd index 4cffe9f..46fab3e 100644 --- a/refpolicy/doc/policy.dtd +++ b/refpolicy/doc/policy.dtd @@ -1,4 +1,4 @@ -<!ENTITY % inline.class "pre|p|ul|li"> +<!ENTITY % inline.class "pre|p|ul|ol|li"> <!ELEMENT policy (layer+,(tunable|boolean)*)> <!ELEMENT layer (summary,module+)> @@ -37,4 +37,5 @@ <!ATTLIST pre caption CDATA #IMPLIED> <!ELEMENT p (#PCDATA|%inline.class;)*> <!ELEMENT ul (li+)> -<!ELEMENT li (#PCDATA|%inline.class;|ul|ol)*> +<!ELEMENT ol (li+)> +<!ELEMENT li (#PCDATA|%inline.class;)*> diff --git a/refpolicy/support/sedoctool.py b/refpolicy/support/sedoctool.py index b2a83b5..1c0414b 100755 --- a/refpolicy/support/sedoctool.py +++ b/refpolicy/support/sedoctool.py @@ -227,16 +227,14 @@ def format_html_desc(node): for desc in node.childNodes: if desc.nodeName == "#text": if desc.data is not '': - desc_buf += "<p>" + desc.data + "</p>" - elif desc.nodeName == "p": - if desc.firstChild.data is not '': - desc_buf += "<p>" + desc.firstChild.data + "</p>" - for chld in desc.childNodes: - if chld.nodeName == "ul": - desc_buf += "<ul>" - for li in chld.getElementsByTagName("li"): - desc_buf += "<li>" + li.firstChild.data + "</li>" - desc_buf += "</ul>" + if desc.parentNode.nodeName != "p": + desc_buf += "<p>" + desc.data + "</p>" + else: + desc_buf += desc.data + else: + desc_buf += "<" + desc.nodeName + ">" \ + + format_html_desc(desc) \ + + "</" + desc.nodeName +">" return desc_buf