Fix handling of ordered and unordered HTML lists.
This commit is contained in:
parent
022f61c0e3
commit
78d30cb1f4
|
@ -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.
|
||||
|
|
|
@ -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;)*>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue