Allow None render hooks
This commit is contained in:
parent
7780d2b1f1
commit
b47085ff6a
|
@ -9,7 +9,10 @@ import re
|
||||||
|
|
||||||
class Renderable():
|
class Renderable():
|
||||||
def render(self, renderer):
|
def render(self, renderer):
|
||||||
return getattr(renderer, type(self).__name__)(self)
|
hook = getattr(renderer, type(self).__name__, None)
|
||||||
|
if hook:
|
||||||
|
return hook(self)
|
||||||
|
return None
|
||||||
|
|
||||||
class TextSpan(Renderable):
|
class TextSpan(Renderable):
|
||||||
"""An unstyled length of text"""
|
"""An unstyled length of text"""
|
||||||
|
|
Loading…
Reference in New Issue