Esempio n. 1
0
 def render_inner(self, token):
     lines = []
     line = []
     for child in token.children:
         if child.__class__.__name__ == "LineBreak":
             if child.soft:
                 line.append(RawText(" "))
             else:
                 lines.append(line)
                 line = []
         else:
             line.append(child)
     lines.append(line)
     return [self.reduce_line([self.render(j) for j in i]) for i in lines]
Esempio n. 2
0
 def __init__(self, match):
     self.username = match.group(1)
     self.children = (RawText(self.username), )
Esempio n. 3
0
 def __init__(self, match):
     content = match.group(self.parse_group)
     self.children = (RawText(content), )
     self.target = content
     self.mailto = (0 and '@' in self.target
                    ) and 'mailto' not in self.target.casefold()
 def __init__(self, match):
     lines, open_info = match
     self.language = EscapeSequence.strip(open_info[2])
     self.directive = EscapeSequence.strip(open_info[3])
     self.children = (RawText(''.join(lines)), )
Esempio n. 5
0
def raw_text(text: str) -> RawText:
    """Create a RawText token."""
    return RawText(text)
Esempio n. 6
0
File: zfm.py Progetto: mk12/zendown
 def render_raw_text(self, token: RawText) -> str:
     if self.smart_typography:
         token.content = smartify(token.content)
     return super().render_raw_text(token)
Esempio n. 7
0
 def __init__(self, match_obj):
     self.children = (RawText(match_obj.group()), )