]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/docs/bin/docparser/restconvert.py
11 html_classlink_re
= "<A HREF=\".*?\">(.*?)</A>"
14 # \n is useless in the HTML docs, we'll use P tags to break paragraphs.
15 restText
= html
.replace("\n", "")
16 restText
= restText
.replace("*", "\\*")
17 if restText
.find("<P>") == 0:
18 restText
= restText
[3:]
20 link_regex
= re
.compile(html_classlink_re
, re
.DOTALL | re
.MULTILINE | re
.IGNORECASE
)
21 restText
= link_regex
.sub("`\g<1>`", restText
)
24 for htmltag
in conversion_table
:
26 for tagname
in [htmltag
, htmltag
.lower()]:
27 restText
= restText
.replace("<%s>" % tagname
, conversion_table
[htmltag
])
28 restText
= restText
.replace("</%s>" % tagname
, conversion_table
[htmltag
])
30 # we need to escape any remaining double-quotes
31 restText
= restText
.replace('"', '\\"')
32 return restText
.strip()