Skip to content

Escaping apostrophe in sheet name #64

Description

@wojciechczerniak

Description

Extracted from #12

@swistak35 mentioned that sheetName does not support escaping apostrophe

ODFF says that it should be escaped by doubling it:

SheetNames include single-quote“'” (APOSTROPHE, U+0027) characters by doubling them and having the entire name surrounded by single-quotes.

This is an enhancement, can be added in a minor version.

Test

Is already added

xit('escaping support', () => {
const sheetMapping = new SheetMapping(enGB)
sheetMapping.addSheet('Sheet1')
sheetMapping.addSheet("Some'sheet")
const parser = new ParserWithCaching(new Config(), sheetMapping.get)
const ast = parser.parse("='Some''sheet'!A1", CellAddress.absolute(0, 0, 0)).ast as CellReferenceAst
expect(ast.type).toBe(AstNodeType.CELL_REFERENCE)
expect(ast.reference.sheet).toBe(1)
})

JavaScript escaping should work as well:

const ast = parser.parse('=\'Somesheet\'!A1')
const ast = parser.parse('=\'Some\'\'sheet\'!A1')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FeatureSomething we can add later on without introducing a breaking changeODFF ConformanceODDF 1.3 Evaluator requirementODFF SGEODDF 1.3 Small Group Evaluator requirementVerifiedVerified by Handsoncode

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions