Skip to content
This repository was archived by the owner on Sep 24, 2022. It is now read-only.
This repository was archived by the owner on Sep 24, 2022. It is now read-only.

Unable to call HtmlRenderer's paragraph method #73

Open
@noisytoken

Description

@noisytoken

I am creating a customer renderer to adds admonition tags to Markdown.

import misaka as m
import re
import houdini as h


class CustomHTMLRenderer(m.HtmlRenderer):
    def paragraph(self, content):
        _prefix_re = re.compile(r'^\s*(!{1,4})\s+')

        CLASSES = {
            1: 'note',
            2: 'info',
            3: 'tip',
            4: 'warning',
        }

        match = _prefix_re.match(content)
        if match is None:
            return super(CustomHTMLRenderer, self).paragraph(content)  ## this call is the problem
        else:
            # do something
            pass

When paragraph() method is called I get this error:

AttributeError: 'super' object has no attribute 'paragraph'
From cffi callback <function cb_paragraph at 0x7f4fb4108b70>:
Traceback (most recent call last):
  File "/home/x/project/env/lib/python3.6/site-packages/misaka/callbacks.py", line 82, in cb_paragraph
    result = renderer.paragraph(content)
  File "/home/x/project/django_project/wiki/utils.py", line 99, in paragraph
    return super(CustomHTMLRenderer, self).paragraph(content)
AttributeError: 'super' object has no attribute 'paragraph'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions