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

Feature request: Support react children elements #4

Open
slavik-chapelskyi opened this issue Jun 15, 2020 · 1 comment
Open

Feature request: Support react children elements #4

slavik-chapelskyi opened this issue Jun 15, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@slavik-chapelskyi
Copy link

Your library perfectly fits into one of my needs and renders hashtags from a string.
But in other place I need to "hashtagify" html string and basically what I need it to be able somehow to parse not only a string child.

Example:

const text = "<p>Here is some content with a #hashtag</p>";

<ReactHashtag renderHashtag={hashtag => <Hashtag hashtag={hashtag} />}>
	<div
        dangerouslySetInnerHTML={{
          __html: text
        }}
      />
</ReactHashtag>

I am wondering is this somehow possible to be added to this package?

@cristianbote cristianbote added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jun 19, 2020
@cristianbote
Copy link
Owner

Hey @slavik-chapelskyi thanks for opening this issue!

That's a neat idea! I think react-hashtag could expose the inner function that parses the string and with that one you could do it easily. Top of my head of course it's been a while since I worked on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants