Allow children to return HTML
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- tooling
Research direction
Start by reproducing the RSS example with reactElementToJSXString and inspect how child text containing HTML and CDATA is serialized. Determine the expected output for HTML children and verify the behavior with a focused regression test; done means the generated JSX preserves the requested child representation without the current string transformation.
Written by the indexing model from the issue text.
Description
I'm trying to generate RSS feed using reactElementToJSXString from a React element.
When I try to render the content of the blog post, it should look something like this:
<codearea>
<![CDATA[
<div> <p> my para </p> </div>
]]>
</description>
However, it seems like all the HTML is transformed into a string:
<description>
{`<![CDATA[<div> <p> my para </p> </div> ]]>`}
</description>
My React code:
import type { JSONFeed } from "./feed-type";
export const RSS = (feed: JSONFeed) => (
<rss version="2.0">
<channel>
{feed.items?.map((item) => {
return (
<item>
<description>{`<![CDATA[${item.content_text}]]>`}</description>
</item>
);
})}
</channel>
</rss>
);
Is it possible to have it rendered without being turned into a string?
- Dominant language
- TypeScript
- Stars
- 519
- Forks
- 88
- Avg merge
- 3h 55m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from algolia/react-element-to-jsx-string
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
All issues in algolia/react-element-to-jsx-string
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
bug triage:in-progress
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
redhat-developer/rhdh-plugin-export-overlays#4845 · 1 comment ·
Maintainers usually reply within 1 day
-
chore kaizen ui-rewrite
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
IBM/mcp-context-forge#7681 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cloudflare/workers-sdk#17159 ·
Maintainers usually reply within 1 day