Skip to content

Trim is not a function #42

@leepowelldev

Description

@leepowelldev

Having an issue with Typescript 4.3.2 and line 476 on parser.js

var trimmedText = (tag.text || '').trim();
...
TypeError: (tag.text || "").trim is not a function

I output the console and can see in certain scenarios that instead of getting:

{
  name: string,
  text: string
}

I am getting this kind of structure:

{
  name: 'see',
  text: [
    { text: 'https', kind: 'text' },
    {
      text: '://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute',
      kind: 'text'
    }
  ]
}

I'll try to dig deeper tonight to see if I can find out what is happening and try to create a simplified demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions