Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

textLength should not be kebap-cased #483

Open

Description

@chrisv2

textLenght is a valid attribute on svg:tspan and svg:text: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/textLength

Unfortunately, textLength gets kebap-cased to text-length because it matches the CAMEL_PROPS regex.

Comparing with the SVG attribute reference, the following attributes are likely affected:

  • clipPathUnits
  • glyphRef
  • markerHeight, markerUnit, markerWidth
  • textLength
  • xChannelSelector

Activity

  1. itslevo commented on Jul 27, 2018

    @itslevo

    Can confirm, clipPathUnits gets rendered as clip-pathunits.

  2. developit commented on Aug 6, 2018

    @developit
    Member

    Hmm - it looks like the regex that is handling clipPathUnits is missing /g, so it only replaces the first uppercase character:

    https://github.com/developit/preact-compat/blob/6029c6e25f6d1c6461d5cc24a9c8bdc781f6ab87/src/index.js#L123

  3. ikoruk commented on Jan 16, 2019

    @ikoruk

    Is there a temporary workaround until this is fixed?

  4. itsthesteve commented on Feb 13, 2019

    @itsthesteve

    @ikoruk this bit me today. With the g flag it gets converted to kebab which isn't the solution as far as I can tell with. Is there a way to denylist certain attributes, or svg attributes as a whole? I'm not super familiar with the internals.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions