Skip to content

Escaping apostrophe in sheet name #64

Closed

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

  1. added
    ODFF SGE
    ODFF Conformance
    Feature
    on Dec 6, 2019
  2. added this to the Next milestone on Jan 7, 2020
  3. self-assigned this
    on Jun 2, 2020
  4. added
    Verified
    on Jun 23, 2020
  5. wojciechczerniak commented on Sep 11, 2020

    @wojciechczerniak
    ContributorAuthor

    Done in #514

  6. added a commit that references this issue on Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FeatureODFF ConformanceODFF SGEVerified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions