Did I find the right examples for you? yes no

All Samples(76)  |  Call(72)  |  Derive(0)  |  Import(4)

src/p/y/python-creole-1.1.1/creole/html_parser/parser.py   python-creole(Download)
from creole.html_tools.strip_html import strip_html
from creole.py3compat import TEXT_TYPE, BINARY_TYPE
from creole.shared.document_tree import DocNode, DebugList
from creole.shared.html_parser import HTMLParser
 
        self.blockdata = []
 
        self.root = DocNode("document", None)
        self.cur = self.root
 
        if headline:
            self.cur = DocNode(
                "headline", self.cur, level=int(headline.group(1))
            )
            return
 
        if tag in ("li", "ul", "ol"):
            if tag in ("ul", "ol"):
                self.__list_level += 1
            self.cur = DocNode(tag, self.cur, None, attrs, level=self.__list_level)
            # wrong: <img src="/image.jpg"> doesn't work if </img> not exist
            # right: <img src="/image.jpg" />
            DocNode(tag, self.cur, None, attrs)
        else:
            self.cur = DocNode(tag, self.cur, None, attrs)

src/p/y/python-creole-HEAD/creole/html_parser/parser.py   python-creole(Download)
from creole.html_tools.strip_html import strip_html
from creole.py3compat import TEXT_TYPE, BINARY_TYPE
from creole.shared.document_tree import DocNode, DebugList
from creole.shared.html_parser import HTMLParser
 
        self.blockdata = []
 
        self.root = DocNode("document", None)
        self.cur = self.root
 
        if headline:
            self.cur = DocNode(
                "headline", self.cur, level=int(headline.group(1))
            )
            return
 
        if tag in ("li", "ul", "ol"):
            if tag in ("ul", "ol"):
                self.__list_level += 1
            self.cur = DocNode(tag, self.cur, None, attrs, level=self.__list_level)
            # wrong: <img src="/image.jpg"> doesn't work if </img> not exist
            # right: <img src="/image.jpg" />
            DocNode(tag, self.cur, None, attrs)
        else:
            self.cur = DocNode(tag, self.cur, None, attrs)

src/p/y/python-creole-1.1.1/creole/creole2html/parser.py   python-creole(Download)
    SpecialRules, InlineRules
from creole.py3compat import TEXT_TYPE
from creole.shared.document_tree import DocNode, DebugList
 
 
        self.blog_line_breaks = blog_line_breaks
 
        self.root = DocNode('document', None)
        self.cur = self.root        # The most recent document node
        self.text = None            # The node to add inline characters to
 
        if self.cur.kind in ('document', 'section', 'blockquote'):
            self.cur = DocNode('paragraph', self.cur)
 
        text = groups.get('text', "")
        if groups.get('break') and self.cur.kind in ('paragraph',
            'emphasis', 'strong', 'pre_inline'):
            self.last_text_break = DocNode('break', self.cur, "")
 
        self.text = None
            # this url is NOT escaped
            target = groups.get('url_target', "")
            node = DocNode('link', self.cur)
            node.content = target
            DocNode('text', node, node.content)

src/p/y/python-creole-HEAD/creole/creole2html/parser.py   python-creole(Download)
    SpecialRules, InlineRules
from creole.py3compat import TEXT_TYPE
from creole.shared.document_tree import DocNode, DebugList
 
 
        self.blog_line_breaks = blog_line_breaks
 
        self.root = DocNode('document', None)
        self.cur = self.root        # The most recent document node
        self.text = None            # The node to add inline characters to
 
        if self.cur.kind in ('document', 'section', 'blockquote'):
            self.cur = DocNode('paragraph', self.cur)
 
        text = groups.get('text', "")
        if groups.get('break') and self.cur.kind in ('paragraph',
            'emphasis', 'strong', 'pre_inline'):
            self.last_text_break = DocNode('break', self.cur, "")
 
        self.text = None
            # this url is NOT escaped
            target = groups.get('url_target', "")
            node = DocNode('link', self.cur)
            node.content = target
            DocNode('text', node, node.content)