Skip to content

Docs: document apostrophe as an explicit string literal trigger #960

Closed

Description

@sequba

Description

It's an undocumented feature

By starting the cell content with ' character (apostrophe) our parser treats the rest of it as string. It is a way to prevent automatic conversion strings to number, date and time values.

Links

https://handsoncode.slack.com/archives/C031GBX62SE/p1667382294314379 (internal discussion)
#959

it('starts with \'', () => {
expect(cellContentParser.parse('\'123')).toEqual(new CellContent.String('123'))
expect(cellContentParser.parse('\'=1+1')).toEqual(new CellContent.String('=1+1'))
expect(cellContentParser.parse('\'\'1')).toEqual(new CellContent.String('\'1'))
expect(cellContentParser.parse('\' 1')).toEqual(new CellContent.String(' 1'))
expect(cellContentParser.parse(' \'1')).toEqual(new CellContent.String(' \'1'))
expect(cellContentParser.parse('\'02-02-2020')).toEqual(new CellContent.String('02-02-2020'))
})

Type of issue

  • Missing documentation
  • Error in the documentation
  • Request for a demo
  • Request for a tutorial, guide etc.
  • Other issues, suggestions or ideas

Activity

  1. added
    Docs
    on Apr 11, 2022
  2. sequba commented on Dec 15, 2022

    @sequba
    ContributorAuthor

    Possible duplicate: #1087

  3. added
    Good First Issue
    on Jan 5, 2023
  4. removed
    Good First Issue
    on Mar 22, 2023
  5. sequba commented on Oct 31, 2023

    @sequba
    ContributorAuthor

    Another question related to that: #1326

  6. AMBudnik commented on Dec 27, 2023

    @AMBudnik
    Contributor

    Fixed with #1334 in HyperFormula 2.6.1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsImpact: HighReleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions