From: Trent \TiZ\ M. <twi...@gm...> - 2014-04-24 19:58:38
|
Hi. I'm trying to create an extension for Markdown to support the custom HTML tags used in Dedalus, an interactive fiction system. I have the inline stuff working perfectly fine, but I want to create a custom block type for the <page>, <paragraph>, and <object> blocks it uses. I figured an intuitive way to handle that would be to indent the contents. The code I have written so far to try and accomplish this is here: http://pastebin.com/4pVhzeqW Right now, it dumps the following stack trace: Traceback (most recent call last): File "./markded.py", line 81, in <module> """) File "/usr/lib/python2.7/site-packages/markdown/__init__.py", line 300, in convert output = self.serializer(root) File "/usr/lib/python2.7/site-packages/markdown/serializers.py", line 276, in to_xhtml_string return _write_html(ElementTree(element).getroot(), format="xhtml") File "/usr/lib/python2.7/site-packages/markdown/serializers.py", line 198, in _write_html qnames, namespaces = _namespaces(root, default_namespace) File "/usr/lib/python2.7/site-packages/markdown/serializers.py", line 264, in _namespaces add_qname(key) File "/usr/lib/python2.7/site-packages/markdown/serializers.py", line 244, in add_qname _raise_serialization_error(qname) File "/usr/lib/python2.7/site-packages/markdown/serializers.py", line 78, in _raise_serialization_error "cannot serialize %r (type %s)" % (text, type(text).__name__) TypeError: cannot serialize <built-in function id> (type builtin_function_or_method) What am I doing wrong that is causing this error to occur? I'm not a good Python programmer by any stretch of the imagination, and I imagine my code is probably pretty horrible. I'm sure I am going about this completely wrong, and I'm sure that's related to why I'm getting this error. Thank you for your time. |