Пример #1
0
    def wrap(self):
        if DEBUG:
            print("Wrapping list item...")

        p_style, list_level, list_type = get_current_li(self.section.extra)

        self.cell_object.add_paragraph(style=p_style)

        numbered = False
        if list_type == ORDERED_LIST_NAME:
            numbered = True

        utils.list_number(self.cell_object.cell,
                          self.cell_object.paragraph,
                          level=list_level,
                          num=numbered)

        if isinstance(self.section.contents, str):
            insert_text(self.cell_object, self.section.contents)
            return

        temp_section = MarkdownSection('markdown', self.section.contents, {},
                                       {})
        temp_section.propagate_extra('inline', True)

        markdown.invoke(self.cell_object,
                        temp_section,
                        invoked_from_wrapper=True)
Пример #2
0
    def wrap(self):
        if DEBUG:
            print("Wrapping Ul...")

        temp_section = MarkdownSection('markdown', self.section.contents, {},
                                       {})

        p_style, list_level, list_type = get_current_li(
            self.section.extra, UNORDERED_LIST_NAME)
        temp_section.propagate_extra('list_level',
                                     list_level,
                                     only_multiple_children=False)
        temp_section.propagate_extra('list_type',
                                     list_type,
                                     only_multiple_children=False)

        markdown.invoke(self.cell_object,
                        temp_section,
                        invoked_from_wrapper=True)