Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs : Fix - Add and handle Regex replacing logics and add regex for … #3372

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abolraj
Copy link

@abolraj abolraj commented Jan 10, 2025

…numbers

I added a an abilitity to jsx converter, for replacing with the Regex patterns. In another hand, you can use youre desired Regex patterns after now for converting desired text parts to the desired replacement.

e.g. I added an example for number convertion

<progress class="progress w-56" value="10" max="100"></progress>

Will be such as below

<Progress className="progress w-56" value={10} max={100}></Progress>

…numbers

I added a an abilitity to jsx converter, for replacing with the Regex patterns. In another hand, you can use youre desired Regex patterns after now for converting desired text parts to the desired replacement.
@saadeghi saadeghi self-assigned this Jan 10, 2025
@@ -56,10 +62,18 @@ export function htmlToJsx(node) {
)

function update() {
node.innerHTML = originalContent.replace(
originalContent = originalContent.replace(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

originalContent is const. can not be re-assigned.

src/docs/src/lib/actions.svelte.js Outdated Show resolved Hide resolved
Copy link
Owner

@saadeghi saadeghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, value="10" is not turning to value={10} with this PR. Am I missing something?

The originalContent is constant, so i use an alternative variable as JSXContent to work on content with replacers.
@abolraj
Copy link
Author

abolraj commented Jan 13, 2025

@saadeghi
I think if we have value={10} is semantic rather than value="10" as React components.

Thank you to support ❤️!

@saadeghi
Copy link
Owner

Yeah... But is your code working?

@abolraj
Copy link
Author

abolraj commented Jan 13, 2025

@saadeghi I tested as logics added and test passed. But you can test it in your whole project as daysiUI owner ! 🔥

@abolraj
Copy link
Author

abolraj commented Jan 19, 2025

@saadeghi waiting for your reaction...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants