Skip to content

Commit

Permalink
Handle text-transform style attribute property (#11)
Browse files Browse the repository at this point in the history
* refactor: use loop to iterate over vnode style keys

Signed-off-by: Kushal Kumar <kushalkumargupta4@gmail.com>

* feat: handle text-transform style attribute

Signed-off-by: K-Kumar-01 <59891164+K-Kumar-01@users.noreply.github.com>

* docs: include text-transform testcase in the examples

Signed-off-by: K-Kumar-01 <59891164+K-Kumar-01@users.noreply.github.com>

---------

Signed-off-by: Kushal Kumar <kushalkumargupta4@gmail.com>
Signed-off-by: K-Kumar-01 <59891164+K-Kumar-01@users.noreply.github.com>
  • Loading branch information
K-Kumar-01 authored Apr 7, 2024
1 parent 9a1ba88 commit 1da50af
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 139 deletions.
31 changes: 31 additions & 0 deletions example/example-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,37 @@ const htmlString = `<!DOCTYPE html>
<strong> Inside a and strong</strong>
<i>Inside italics and a</i>
</a>
<p>Here we check for text-transform properties</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i style="text-transform:uppercase">this capitalized </i>
<span style="color: blue">Hello world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i >this capitalized </i>
<span style="color: blue">heLLo world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value <span style="text-transform:lowercase;"> this is lowercase </span> <strong style="text-transform:capitalize;">
<i>this capitalized</i>
<span style="color: blue">Hello world</span>
<span>no change should happen here</span>
</strong>
</p>
</body>
</html>`;

Expand Down
31 changes: 31 additions & 0 deletions example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,37 @@ const htmlString = `<!DOCTYPE html>
<strong> Inside a and strong</strong>
<i>Inside italics and a</i>
</a>
<p>Here we check for text-transform properties</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i style="text-transform:uppercase">this capitalized </i>
<span style="color: blue">Hello world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i >this capitalized </i>
<span style="color: blue">heLLo world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value <span style="text-transform:lowercase;"> this is lowercase </span> <strong style="text-transform:capitalize;">
<i>this capitalized</i>
<span style="color: blue">Hello world</span>
<span>no change should happen here</span>
</strong>
</p>
</body>
</html>`;

Expand Down
31 changes: 31 additions & 0 deletions example/react-example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,37 @@ const htmlString = `<!DOCTYPE html>
<strong> Inside a and strong</strong>
<i>Inside italics and a</i>
</a>
<p>Here we check for text-transform properties</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i style="text-transform:uppercase">this capitalized </i>
<span style="color: blue">Hello world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value
<span style="text-transform:lowercase;">this is lowercase </span>
<strong style="text-transform:capitalize;">
<i >this capitalized </i>
<span style="color: blue">heLLo world </span>
<span>capitalize should happen inside</span>
</strong>
<span>Uppercase not other changes</span>
</p>
<p style="text-transform: uppercase">
Adding one value <span style="text-transform:lowercase;"> this is lowercase </span> <strong style="text-transform:capitalize;">
<i>this capitalized</i>
<span style="color: blue">Hello world</span>
<span>no change should happen here</span>
</strong>
</p>
</body>
</html>`;

Expand Down
Loading

0 comments on commit 1da50af

Please sign in to comment.