Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 7923:29a666d8a70d
issue2551285 - Remove StructuredText support
Asked on the users mailing list if anybody was using it. Got no responses.
I have never seen CI installing structuredtext packages so it's
untested as well.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 30 Apr 2024 22:27:57 -0400 |
| parents | 7d621b3ba8ba |
| children | a9b136565838 |
comparison
equal
deleted
inserted
replaced
| 7922:ded9f1c3f112 | 7923:29a666d8a70d |
|---|---|
| 35 from roundup.cgi.timestamp import pack_timestamp | 35 from roundup.cgi.timestamp import pack_timestamp |
| 36 from roundup.exceptions import RoundupException | 36 from roundup.exceptions import RoundupException |
| 37 | 37 |
| 38 from .KeywordsExpr import render_keywords_expression_editor | 38 from .KeywordsExpr import render_keywords_expression_editor |
| 39 | 39 |
| 40 try: | |
| 41 from StructuredText.StructuredText import HTML as StructuredText | |
| 42 except ImportError: | |
| 43 try: # older version | |
| 44 import StructuredText | |
| 45 except ImportError: | |
| 46 StructuredText = None | |
| 47 try: | 40 try: |
| 48 from docutils.core import publish_parts as ReStructuredText | 41 from docutils.core import publish_parts as ReStructuredText |
| 49 except ImportError: | 42 except ImportError: |
| 50 ReStructuredText = None | 43 ReStructuredText = None |
| 51 try: | 44 try: |
| 1864 if not escape: | 1857 if not escape: |
| 1865 s = html_escape(s) | 1858 s = html_escape(s) |
| 1866 s = self.hyper_re.sub(self._hyper_repl, s) | 1859 s = self.hyper_re.sub(self._hyper_repl, s) |
| 1867 return s | 1860 return s |
| 1868 | 1861 |
| 1869 def stext(self, escape=0, hyperlink=1): | |
| 1870 """ Render the value of the property as StructuredText. | |
| 1871 | |
| 1872 This requires the StructureText module to be installed separately. | |
| 1873 """ | |
| 1874 if not self.is_view_ok(): | |
| 1875 return self._('[hidden]') | |
| 1876 | |
| 1877 s = self.plain(escape=escape, hyperlink=hyperlink) | |
| 1878 if not StructuredText: | |
| 1879 return s | |
| 1880 return StructuredText(s, level=1, header=0) | |
| 1881 | |
| 1882 def rst(self, hyperlink=1): | 1862 def rst(self, hyperlink=1): |
| 1883 """ Render the value of the property as ReStructuredText. | 1863 """ Render the value of the property as ReStructuredText. |
| 1884 | 1864 |
| 1885 This requires docutils to be installed separately. | 1865 This requires docutils to be installed separately. |
| 1886 """ | 1866 """ |
