コード例 #1
0
ファイル: models.py プロジェクト: b-dev/pybbm
 def render(self):
     self.body_html = defaults.PYBB_MARKUP_ENGINES[defaults.PYBB_MARKUP](
         self.body)
     # Remove tags which was generated with the markup processor
     text = strip_tags(self.body_html)
     # Unescape entities which was generated with the markup processor
     self.body_text = unescape(text)
コード例 #2
0
ファイル: models.py プロジェクト: Maplecroft/pybbm
 def render(self):
     self.body_html = defaults.PYBB_MARKUP_ENGINES[
         defaults.PYBB_MARKUP](self.body)
     # Remove tags which was generated with the markup processor
     text = strip_tags(self.body_html)
     # Unescape entities which was generated with the markup processor
     self.body_text = unescape(text)
コード例 #3
0
    def render(self, commit=False):
        self.body_html = markup(self.body, obj=self)

        # Remove tags which was generated with the markup processor
        text = strip_tags(self.body_html)
        # Unescape entities which was generated with the markup processor
        self.body_text = unescape(text)

        if commit:
            update_fields(self, fields=('body_html', 'body_text', ))
コード例 #4
0
ファイル: models.py プロジェクト: widelands/widelands-website
    def render(self):
        if self.markup == 'bbcode':
            self.body_html = mypostmarkup.markup(self.body, auto_urls=False)
        elif self.markup == 'markdown':
            self.body_html = str(do_wl_markdown(self.body, 'bleachit'))
        else:
            raise Exception('Invalid markup property: %s' % self.markup)

        # Remove tags which was generated with the markup processor
        text = strip_tags(self.body_html)

        # Unescape entities which was generated with the markup processor
        self.body_text = unescape(text)

        self.body_html = urlize(self.body_html)
コード例 #5
0
    def render(self):
        if self.markup == 'bbcode':
            self.body_html = mypostmarkup.markup(self.body, auto_urls=False)
        elif self.markup == 'markdown':
            instance = Markdown(safe_mode='escape')
            self.body_html = unicode(instance.convert(self.body))
        else:
            raise Exception('Invalid markup property: %s' % self.markup)

        # Remove tags which was generated with the markup processor
        text = strip_tags(self.body_html)

        # Unescape entities which was generated with the markup processor
        self.body_text = unescape(text)

        self.body_html = urlize(self.body_html)
コード例 #6
0
ファイル: models.py プロジェクト: DanteBortone/pybbm
 def render(self):
     self.body_html = _get_markup_formatter()(self.body, instance=self)
     # Remove tags which was generated with the markup processor
     text = strip_tags(self.body_html)
     # Unescape entities which was generated with the markup processor
     self.body_text = unescape(text)
コード例 #7
0
ファイル: models.py プロジェクト: wengole/pybbm
 def render(self):
     self.body_html = _get_markup_formatter()(self.body)
     # Remove tags which was generated with the markup processor
     text = strip_tags(self.body_html)
     # Unescape entities which was generated with the markup processor
     self.body_text = unescape(text)