Switch to unified view
a/Allura/allura/controllers/static.py | b/Allura/allura/controllers/static.py | ||
---|---|---|---|
... |
... |
||
13 | 13 | ||
14 | @expose() |
14 | @expose() |
15 | @without_trailing_slash |
15 | @without_trailing_slash |
16 | def markdown_to_html(self, markdown, neighborhood=None, project=None, app=None): |
16 | def markdown_to_html(self, markdown, neighborhood=None, project=None, app=None): |
17 | """Convert markdown to html.""" |
17 | """Convert markdown to html.""" |
18 | if project: |
18 | if neighborhood is None or project is None: |
19 | if neighborhood: |
19 | raise exc.HTTPBadRequest() |
20 | n = M.Neighborhood.query.get(name=neighborhood) |
20 | h.set_context(project, app, neighborhood=neighborhood) |
21 | project = M.Project.query.get(shortname=project, neighborhood_id=n._id) |
||
22 | g.set_project(project) |
||
23 | if app: |
||
24 | g.set_app(app) |
||
25 | html = g.markdown_wiki.convert(markdown) |
21 | html = g.markdown_wiki.convert(markdown) |
26 | return html |
22 | return html |
27 | 23 | ||
28 | @expose() |
24 | @expose() |
29 | @with_trailing_slash |
25 | @with_trailing_slash |