equal
deleted
inserted
replaced
791 """helper method to dynamically set request content type to text/html |
791 """helper method to dynamically set request content type to text/html |
792 |
792 |
793 The global doctype and xmldec must also be changed otherwise the browser |
793 The global doctype and xmldec must also be changed otherwise the browser |
794 will display '<[' at the beginning of the page |
794 will display '<[' at the beginning of the page |
795 """ |
795 """ |
796 self.set_content_type('text/html') |
796 if not self.vreg.config['force-html-content-type']: |
797 self.main_stream.set_doctype(TRANSITIONAL_DOCTYPE_NOEXT) |
797 if not hasattr(self, 'main_stream'): |
|
798 raise Exception("Can't demote to html from an ajax context. You " |
|
799 "should change force-html-content-type to yes " |
|
800 "in the instance configuration file.") |
|
801 self.set_content_type('text/html') |
|
802 self.main_stream.set_doctype(TRANSITIONAL_DOCTYPE_NOEXT) |
798 |
803 |
799 def set_doctype(self, doctype, reset_xmldecl=True): |
804 def set_doctype(self, doctype, reset_xmldecl=True): |
800 """helper method to dynamically change page doctype |
805 """helper method to dynamically change page doctype |
801 |
806 |
802 :param doctype: the new doctype, e.g. '<!DOCTYPE html>' |
807 :param doctype: the new doctype, e.g. '<!DOCTYPE html>' |