Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

use allowSurrogateChars for emoji support #141

Merged
merged 1 commit into from
Feb 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions source/lib/workbook/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ let addRootContentTypesXML = (promiseObj) => {
{
'version': '1.0',
'encoding': 'UTF-8',
'standalone': true
'standalone': true,
'allowSurrogateChars': true
}
)
.att('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types');
Expand Down Expand Up @@ -224,7 +225,8 @@ let addSharedStringsXML = (promiseObj) => {
{
'version': '1.0',
'encoding': 'UTF-8',
'standalone': true
'standalone': true,
'allowSurrogateChars': true
}
)
.att('count', promiseObj.wb.sharedStrings.length)
Expand Down Expand Up @@ -315,7 +317,8 @@ let addStylesXML = (promiseObj) => {
{
'version': '1.0',
'encoding': 'UTF-8',
'standalone': true
'standalone': true,
'allowSurrogateChars': true
}
)
.att('mc:Ignorable', 'x14ac')
Expand Down
8 changes: 6 additions & 2 deletions source/lib/worksheet/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,12 @@ let sheetXML = (ws) => {

let xmlProlog = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
let xmlString = '';
let wsXML = xml.begin((chunk) => {
let wsXML = xml.begin({
allowSurrogateChars: true,
}, (chunk) => {
xmlString += chunk;
})

.ele('worksheet')
.att('mc:Ignorable', 'x14ac')
.att('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main')
Expand Down Expand Up @@ -514,7 +517,8 @@ let relsXML = (ws) => {
{
'version': '1.0',
'encoding': 'UTF-8',
'standalone': true
'standalone': true,
'allowSurrogateChars': true
}
);
relXML.att('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
Expand Down