Comments (3)
Are you talking about HTMLElement nodes and not React nodes? They're pretty much destroyed/forgotten after the initial parse, as I build a new tree.
Do you have a pseudo example by chance?
from interweave.
So, I expect to have original HTML source like:
<p>This is some text.</p>
<ul>
<li>This is a list.</li>
</ul>
<ul class="Tasklist">
<li>This is a task list.</li>
</ul>
My aim is to end up with a React tree like:
<Fragment>
<p>This is some text</p>
<p>This is some text.</p>
<ul>
<li>This is a list.</li>
</ul>
<Tasklist someProps={ { controlledBy: "me" } } />
</Fragment>
How that actually happens, I don't mind. Matchers seem like a natural way to do this, bar the fact they're operating on node content rather than the original HTML content. If I had [Tasklist]
in the source instead, I could match that, so it seems like we should be able to do similar with actual HTML elements.
Ideally, I'd be able to have a matcher-style object which receives nodes instead of text. Once the initial parse is complete, I don't care about the nodes, only my React element.
from interweave.
I think what I'm looking for is the equivalent of react-html-parser's transform. I'll take a look at adding something similar.
from interweave.
Related Issues (20)
- Is there any way to match html based on an elements class attribute? HOT 2
- Youtube embed video with the iframe is not loading the video on the browser. HOT 4
- Interweave: Missing emoji source data. HOT 19
- Transform Docs Update Suggestions
- Cannot resolve interweave HOT 1
- import error HOT 1
- Certain HTML attributes such as tabindex is not supported HOT 2
- Version 13.1.0 is missing from the CHANGELOG.md
- React JSX Support HOT 3
- SSR Hydration issue when email (text) is present in html content
- SSR Hydration issue when email (text) is present in html content
- Html content are wrapping with span element as parent element HOT 4
- ID attribute is not working HOT 7
- colons in hash part break links HOT 1
- why interweave transform attributes to lowercase? HOT 5
- Add Tailwind classes in my html content HOT 1
- React error when transforming HOT 2
- 'Interweave' cannot be used as a JSX component. HOT 1
- Broken emoji PNG-s in emoji-picker
- Performance significantly drops for nested HTML HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interweave.