Commit f41ccd88 authored by Andreas Jung's avatar Andreas Jung

- tag attributes are now quotes

- inner links are now generated as <a name="#ref<number>">
  (it is illegal that tokens start with a digit)
parent cebcd94b
...@@ -255,7 +255,7 @@ class HTMLClass: ...@@ -255,7 +255,7 @@ class HTMLClass:
output("</u>") output("</u>")
def innerLink(self, doc, level, output): def innerLink(self, doc, level, output):
output('<a href="#'); output('<a href="#ref');
for c in doc.getChildNodes(): for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output) getattr(self, self.element_types[c.getNodeName()])(c, level, output)
output('">[') output('">[')
...@@ -264,7 +264,7 @@ class HTMLClass: ...@@ -264,7 +264,7 @@ class HTMLClass:
output(']</a>') output(']</a>')
def namedLink(self, doc, level, output): def namedLink(self, doc, level, output):
output('<a name="') output('<a name="ref')
for c in doc.getChildNodes(): for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output) getattr(self, self.element_types[c.getNodeName()])(c, level, output)
output('">[') output('">[')
...@@ -278,7 +278,7 @@ class HTMLClass: ...@@ -278,7 +278,7 @@ class HTMLClass:
def xref(self, doc, level, output): def xref(self, doc, level, output):
val = doc.getNodeValue() val = doc.getNodeValue()
output('<a href="#%s">[%s]</a>' % (val, val) ) output('<a href="#ref%s">[%s]</a>' % (val, val) )
def table(self,doc,level,output): def table(self,doc,level,output):
""" """
...@@ -287,17 +287,17 @@ class HTMLClass: ...@@ -287,17 +287,17 @@ class HTMLClass:
is a type of StructuredTextParagraph and thus holds is a type of StructuredTextParagraph and thus holds
the actual data. the actual data.
""" """
output("<table border=1 cellpadding=2>\n") output('<table border="1" cellpadding="2">\n')
for row in doc.getRows()[0]: for row in doc.getRows()[0]:
output("<tr>\n") output("<tr>\n")
for column in row.getColumns()[0]: for column in row.getColumns()[0]:
if hasattr(column,"getAlign"): if hasattr(column,"getAlign"):
str = "<%s colspan=%s align=%s valign=%s>" % (column.getType(), str = '<%s colspan="%s" align="%s" valign="%s">' % (column.getType(),
column.getSpan(), column.getSpan(),
column.getAlign(), column.getAlign(),
column.getValign()) column.getValign())
else: else:
str = "<td colspan=%s>" % column.getSpan() str = '<td colspan="%s">' % column.getSpan()
output(str) output(str)
for c in column.getChildNodes(): for c in column.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output) getattr(self, self.element_types[c.getNodeName()])(c, level, output)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment