@@ -384,6 +384,12 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
384
384
v = styleObjToCss ( v ) ;
385
385
}
386
386
break ;
387
+ case 'acceptCharset' :
388
+ name = 'accept-charset' ;
389
+ break ;
390
+ case 'httpEquiv' :
391
+ name = 'http-equiv' ;
392
+ break ;
387
393
388
394
default : {
389
395
if ( isSvgMode && XLINK . test ( name ) ) {
@@ -395,6 +401,17 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
395
401
// `draggable` is an enumerated attribute and not Boolean. A value of `true` or `false` is mandatory
396
402
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
397
403
v += '' ;
404
+ } else if ( isSvgMode ) {
405
+ if ( SVG_CAMEL_CASE . test ( name ) ) {
406
+ name =
407
+ name === 'panose1'
408
+ ? 'panose-1'
409
+ : name . replace ( / ( [ A - Z ] ) / g, '-$1' ) . toLowerCase ( ) ;
410
+ } else if ( XML_REPLACE_REGEX . test ( name ) ) {
411
+ name = name . toLowerCase ( ) . replace ( XML_REPLACE_REGEX , 'xml:' ) ;
412
+ }
413
+ } else if ( HTML_LOWER_CASE . test ( name ) ) {
414
+ name = name . toLowerCase ( ) ;
398
415
}
399
416
}
400
417
}
@@ -439,6 +456,9 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
439
456
return s + '>' + html + '</' + type + '>' ;
440
457
}
441
458
459
+ const HTML_LOWER_CASE = / ^ a c c e s s K | ^ a u t o [ A - Z ] | ^ c h | ^ c o l | c o n t | c r o s s | d a t e T | e n c T | f o r m [ A - Z ] | f r a m e | h r e f L | i n p u t M | m a x L | m i n L | n o V | p l a y s I | r e a d O | r o w S | s p e l l C | s r c [ A - Z ] | t a b I | i t e m [ A - Z ] / ;
460
+ const SVG_CAMEL_CASE = / ^ a c | ^ a l i | a r a b i c | b a s e l | c a p | c l i p P a t h $ | c l i p R u l e $ | c o l o r | d o m i n a n t | e n a b l e | f i l l | f l o o d | f o n t | g l y p h [ ^ R ] | h o r i z | i m a g e | l e t t e r | l i g h t i n g | m a r k e r [ ^ W U H ] | o v e r l i n e | p a n o s e | p o i n t e | p a i n t | r e n d e r i n g | s h a p e | s t o p | s t r i k e t h r o u g h | s t r o k e | t e x t [ ^ L ] | t r a n s f o r m | u n d e r l i n e | u n i c o d e | u n i t s | ^ v [ ^ i ] | ^ w | ^ x H / ;
461
+ const XML_REPLACE_REGEX = / ^ x m l : ? / ;
442
462
const XLINK_REPLACE_REGEX = / ^ x l i n k : ? / ;
443
463
const SELF_CLOSING = new Set ( [
444
464
'area' ,
0 commit comments