Skip to content

Commit 0ff6093

Browse files
committed
Add more svg & rss attrs
1 parent 2c5657c commit 0ff6093

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const UNNAMED = [];
1717

1818
const VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;
1919

20-
const DASHED_ATTRS = /^(acceptC|httpE)/;
21-
const CAMEL_ATTRS = /^(viewB|isP)/;
22-
const COLON_ATTRS = /^(xmlS|xlinkH)/;
20+
const DASHED_ATTRS = /^(acceptC|httpE|(clip|color|fill|font|glyph|marker|stop|stroke|text|vert)[A-Z])/;
21+
const CAMEL_ATTRS = /^(isP|viewB)/;
22+
const COLON_ATTRS = /^(xlink|xml|xmlns)[A-Z]/;
2323

2424
const CAPITAL_REGEXP = /([A-Z])/g;
2525

test/render.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ describe('render', () => {
112112
expect(rendered).to.equal(expected);
113113
});
114114

115-
it('should colonize certain attributes & leave certain attributes camelized', () => {
116-
let rendered = render(<svg xmlSpace="preserve" viewBox="0 0 10 10" />),
117-
expected = `<svg xml:space="preserve" viewBox="0 0 10 10"></svg>`;
115+
it('should colonize/dasherize certain attributes & leave certain attributes camelized', () => {
116+
let rendered = render(
117+
<svg xmlSpace="preserve" viewBox="0 0 10 10" fillRule="nonzero" />
118+
),
119+
expected = `<svg xml:space="preserve" viewBox="0 0 10 10" fill-rule="nonzero"></svg>`;
118120

119121
expect(rendered).to.equal(expected);
120122
});

0 commit comments

Comments
 (0)