Skip to content

Issue with writing newlines #296

Closed
Closed
@zhm

Description

@zhm

I'm having an issue writing \n to cells. It's stripping them from the file. I'm using version 0.4.2.

When I monkey patch exceljs to use the entities module, it works correctly.

This is not a permanent fix, just demonstrating how to patch it.

var utils = require('exceljs/lib/utils/utils');
utils.xmlEncode = require('entities').encodeXML;

Looking at the xmlEncode function it does look like it's wrong, it's not allowing \n (0x0A) through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions