# File lib/maruku/input/parse_doc.rb, line 27
        def parse_doc(s)
                # FIXME \r\n => \n
                meta2 =  parse_email_headers(s)
                data = meta2[:data]
                meta2.delete :data
                
                self.attributes.merge! meta2
                
??

                enc = self.attributes[:encoding]
                self.attributes.delete :encoding
                if enc && enc.downcase != 'utf-8'
                        converted = Iconv.new('utf-8', enc).iconv(data)
                        
#                       puts "Data: #{data.inspect}: #{data}"
#                       puts "Conv: #{converted.inspect}: #{converted}"
                        
                        data = converted
                end
                
                @children = parse_text_as_markdown(data)
                
                if true #markdown_extra? 
                        self.search_abbreviations
                        self.substitute_markdown_inside_raw_html
                end
                
                toc = create_toc

                # use title if not set
                if not self.attributes[:title] and toc.header_element
                        title = toc.header_element.to_s
                        self.attributes[:title]  = title
#                       puts "Set document title to #{title}"
                end
                
                # save for later use
                self.toc = toc
                
                # Now do the attributes magic
                each_element do |e|
                        # default attribute list
                        if default = self.ald[e.node_type.to_s]
                                expand_attribute_list(default, e.attributes)
                        end
                        expand_attribute_list(e.al, e.attributes)
#                       puts "#{e.node_type}: #{e.attributes.inspect}"
                end
        
??

                if Maruku::Globals[:unsafe_features]
                        self.execute_code_blocks
                        # TODO: remove executed code blocks
                end
        end