아래 함수를 교체해 주십시오.
openDoc 함수를 아래 코드를 교체해 주십시오.
var html = '<html>' +
'<head><title>' + this.config.docTitle + '</title>' +
'<style></style></head><body>';
doc.open();
if (this.toType(contents) === 'string') {
contents = this.trimSpace(contents);
contents = contents.replace(/<([a-zA-Z]+)\s+([^>]+)>/g, function (all, tagName, attrs) {
var rdata = [];
attrs = attrs.replace(/font-family:([^;>]+)/ig,
function (match, attr) {
attr.split(',').forEach(function (elem) {
elem = elem.trim().replace(/["']/g, '');
if (/\s/.test(elem)) {
elem = '"' + elem.replace(/\s+/g, ' ') + '"';
}
rdata.push(elem);
});
return 'font-family: ' + rdata.join(', ');
});
if (rdata.length > 0 && attrs[attrs.length-1] !== '"') {
attrs = attrs + '"';
}
return '<' + tagName + ' ' + attrs + '>';
});
html += contents;
}
html += '</body></html>';
doc.write(html);
doc.close();