Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

portal 500 error when post begins with an image #6

@haliphax

Description

@haliphax

I have 2 forums currently being displayed in my portal page. One of those forums has a topic in it where an image is the very first thing in the very first post. There is text in the post, as well, but the image comes before anything else. This seems to be causing havoc with the markup renderer. When that forum is removed, the error goes away.

[2018-03-26 18:12:28,411] ERROR in app: Exception on /portal/ [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/site-packages/portal/views.py", line 74, in index
    online_users=online_users)
  File "/usr/local/lib/python2.7/site-packages/flaskbb/utils/helpers.py", line 83, in render_template
    return render_theme_template(theme, template, **context)
  File "/usr/local/lib/python2.7/site-packages/flask_themes2/__init__.py", line 141, in render_theme_template
    return render_template(template_name, **context)
  File "/usr/local/lib/python2.7/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/portal/templates/index.html", line 1, in top-level template code
    {% extends theme("layout.html") %}
  File "/usr/local/lib/python2.7/site-packages/flaskbb/themes/custom/templates/layout.html", line 142, in top-level template code
    {% block content %}
  File "/usr/local/lib/python2.7/site-packages/portal/templates/index.html", line 99, in block "content"
    {{ topic.first_post.content | markup | safe }}<br />
  File "/usr/local/lib/python2.7/site-packages/flaskbb/utils/helpers.py", line 379, in render_markup
    return Markup(markdown.render(text))
  File "/usr/local/lib/python2.7/site-packages/mistune.py", line 977, in render
    return self.parse(text)
  File "/usr/local/lib/python2.7/site-packages/mistune.py", line 980, in parse
    out = self.output(preprocessing(text))
  File "/usr/local/lib/python2.7/site-packages/mistune.py", line 87, in preprocessing
    text = _newline_pattern.sub('\n', text)
TypeError: expected string or buffer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions