Fix handling of ordered and unordered HTML lists.

This commit is contained in:
Chris PeBenito 2005-07-22 19:15:49 +00:00
parent 022f61c0e3
commit 78d30cb1f4
3 changed files with 12 additions and 12 deletions

View File

@ -1,3 +1,4 @@
* Fix handling of ordered and unordered HTML lists.
* Corenetwork now supports multiple network interfaces having the * Corenetwork now supports multiple network interfaces having the
same type. same type.
* Doc tool now creates pages for global Booleans and global tunables. * Doc tool now creates pages for global Booleans and global tunables.

View File

@ -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 policy (layer+,(tunable|boolean)*)>
<!ELEMENT layer (summary,module+)> <!ELEMENT layer (summary,module+)>
@ -37,4 +37,5 @@
<!ATTLIST pre caption CDATA #IMPLIED> <!ATTLIST pre caption CDATA #IMPLIED>
<!ELEMENT p (#PCDATA|%inline.class;)*> <!ELEMENT p (#PCDATA|%inline.class;)*>
<!ELEMENT ul (li+)> <!ELEMENT ul (li+)>
<!ELEMENT li (#PCDATA|%inline.class;|ul|ol)*> <!ELEMENT ol (li+)>
<!ELEMENT li (#PCDATA|%inline.class;)*>

View File

@ -227,16 +227,14 @@ def format_html_desc(node):
for desc in node.childNodes: for desc in node.childNodes:
if desc.nodeName == "#text": if desc.nodeName == "#text":
if desc.data is not '': if desc.data is not '':
if desc.parentNode.nodeName != "p":
desc_buf += "<p>" + desc.data + "</p>" desc_buf += "<p>" + desc.data + "</p>"
elif desc.nodeName == "p": else:
if desc.firstChild.data is not '': desc_buf += desc.data
desc_buf += "<p>" + desc.firstChild.data + "</p>" else:
for chld in desc.childNodes: desc_buf += "<" + desc.nodeName + ">" \
if chld.nodeName == "ul": + format_html_desc(desc) \
desc_buf += "<ul>" + "</" + desc.nodeName +">"
for li in chld.getElementsByTagName("li"):
desc_buf += "<li>" + li.firstChild.data + "</li>"
desc_buf += "</ul>"
return desc_buf return desc_buf