Example #1
0
    def run_quirks(self, process_ref_lists):
        manipulate = NlmManipulate(self.gv)
        if self.gv.setting('linebreaks-as-comments') == 'False':
            # we need to convert every instance of <!--meTypeset:br--> to a new paragraph
            manipulate.close_and_open_tag('comment()[. = "meTypeset:br"]', 'p')

        # we will replace inside table cells and titles regardless because these are real JATS break tags
        manipulate.insert_break('comment()[. = "meTypeset:br"]', 'td')
        manipulate.insert_break('comment()[. = "meTypeset:br"]', 'title')

        manipulate.remove_empty_elements('//sec//p')

        manipulate.tag_inline_refs()

        if process_ref_lists:
            self.debug.print_debug(self, 'Finding potential reference lists')
            manipulate.find_reference_list()
            manipulate.tag_bibliography_refs()

        manipulate.remove_empty_elements('//sec/list')
        manipulate.remove_empty_elements('//sec/disp-quote')
Example #2
0
    def run_quirks(self, process_ref_lists):
        manipulate = NlmManipulate(self.gv)

        if self.gv.settings.get_setting('linebreaks-as-comments',
                                        self) == 'False':
            # we need to convert every instance of <!--meTypeset:br--> to a new paragraph
            manipulate.close_and_open_tag('comment()[. = "meTypeset:br"]', 'p')
            manipulate.close_and_open_tag_not_styled(
                'comment()[. = "meTypeset:br"]', 'title')

        # we will replace inside table cells and titles regardless because these are real JATS break tags
        manipulate.insert_break('comment()[. = "meTypeset:br"]', 'td')
        manipulate.insert_break('comment()[. = "meTypeset:br"]', 'title')

        manipulate.remove_empty_elements('//sec//p')

        if process_ref_lists:
            self.debug.print_debug(self, u'Finding potential reference lists')
            manipulate.find_reference_list()
            manipulate.tag_bibliography_refs()

        manipulate.remove_empty_elements('//sec/list')
        manipulate.remove_empty_elements('//sec/disp-quote')
        manipulate.remove_empty_elements('//back/ref-list/ref')