/** * Create a full HTML document from the processed markdown */ showdown.subParser('completeHTMLDocument', function (text, options, globals) { 'use strict'; if (!options.completeHTMLDocument) { return text; } text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals); var doctype = 'html', doctypeParsed = '\n', title = '', charset = '\n', lang = '', metadata = ''; if (typeof globals.metadata.parsed.doctype !== 'undefined') { doctypeParsed = '\n'; doctype = globals.metadata.parsed.doctype.toString().toLowerCase(); if (doctype === 'html' || doctype === 'html5') { charset = ''; } } for (var meta in globals.metadata.parsed) { if (globals.metadata.parsed.hasOwnProperty(meta)) { switch (meta.toLowerCase()) { case 'doctype': break; case 'title': title = '