~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to pybb/markups/mypostmarkup.py

  • Committer: franku
  • Author(s): GunChleoc
  • Date: 2016-12-13 18:30:38 UTC
  • mfrom: (438.1.6 pyformat_util)
  • Revision ID: somal@arcor.de-20161213183038-5cgmvfh2fkgmoc1s
adding a script to run pyformat over the code base

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
RE_FIRST_LF = re.compile('^\s*\r?\n')
5
5
markup = postmarkup.create(exclude=['link', 'url', 'code'], use_pygments=False)
6
6
 
 
7
 
7
8
class LinkTagNoAnnotate(postmarkup.LinkTag):
8
 
    def annotate_link(self, domain):        
 
9
 
 
10
    def annotate_link(self, domain):
9
11
        return ''
10
12
 
11
13
 
12
14
class CodeTagNoBreak(postmarkup.CodeTag):
 
15
 
13
16
    def render_open(self, parser, node_index):
14
17
 
15
18
        contents = self._escape(self.get_contents(parser))
19
22
 
20
23
    def _escape(self, s):
21
24
        return postmarkup.PostMarkup.standard_replace_no_break(s.rstrip('\n'))
22
 
                
 
25
 
23
26
 
24
27
markup.tag_factory.add_tag(LinkTagNoAnnotate, 'url')
25
28
markup.tag_factory.add_tag(CodeTagNoBreak, 'code')