preact-render-to-string icon indicating copy to clipboard operation
preact-render-to-string copied to clipboard

SVG attributes format

Open nrandell opened this issue 8 years ago • 5 comments

Not sure if this an issue or a clarification. If I have some SVG, such as <path d="M 2 50 A 48 48 0 0 1 50 2" stroke="#gradLeft-1" strokeWidth="4" fill="none" /> It doesn't work correctly. If I change 'strokeWidth' to 'stroke-width' (changed to lower case with a dash) then it does work ok. This is different to react. Is this behaviour correct? or have I done something wrong?

nrandell avatar Feb 17 '17 12:02 nrandell

Ah yeah this looks like an issue. In preact it's more common to use the attribute names, but we do officially support both. We'll need to convert them :)

developit avatar Feb 17 '17 12:02 developit

Great - good to know I wasn't being stupid!

nrandell avatar Feb 17 '17 13:02 nrandell

hello everybody, any progress in this issue? I just stumbled in the same problem

Born2Go avatar Nov 20 '17 01:11 Born2Go

maybe the same issue. current version support http-equiv but not httpEquiv. support charset but not charSet.

magic-akari avatar Dec 03 '17 09:12 magic-akari

Ah yeah this looks like an issue. In preact it's more common to use the attribute names, but we do officially support both. We'll need to convert them :)

react-dom has a file possibleStandardNames.js that can be used to normalize attributes:

https://github.com/facebook/react/blob/ca106a02d1648f4f0048b07c6b88f69aac175d3c/packages/react-dom/src/shared/possibleStandardNames.js

cc @developit

SukkaW avatar Dec 10 '21 13:12 SukkaW