-
-
Notifications
You must be signed in to change notification settings - Fork 135
Update README with advanced usage of replace
method
#17
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
Conversation
@poacher2k Thanks for the pull request! I'm thinking about making a directory What are your thoughts? |
style: { fontSize: '42px' } }, | ||
parsedChildren); | ||
// equivalent jsx syntax: | ||
// return <span key={key} style={{ fontSize: '42px' }}>{parsedChildren}</span>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you refactor this part to:
return React.createElement('span', {
key: key,
style: { fontSize: '42px' },
}, parsedChildren);
// equivalent jsx syntax
// return <span key={key} style={{ fontSize: '42px' }}>{parsedChildren}</span>;
Just to make the indenting a bit more readable.
Sure thing! And an example-folder sounds like a good idea. |
Nice! Lastly, could I trouble you to perform a squash of your commits into a single descriptive commit? I could perform a squash merge via GitHub but you'll need do some extra stuff to sync up your fork. Let me know what's easier for you. |
replace
method
That sounds like a good exercise in broadening my git abilities! It's getting late in Norway, so if it's okay with you, I'll see if I can do this tomorrow after work. If not, go ahead and squash merge it :) |
Sure, let's finalize it tomorrow. And much appreciated for the PR! |
var html = '<div><p id="main"><span class="prettify">keep me and make me pretty!</span></p></div>'; | ||
|
||
var parserConfig = { | ||
replace: function(domNode, key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up removing key
parameter in #18 as I realized there's a better and easier way of doing things.
If you would be so kind, could you remove key
in your examples before performing the squash? Thanks so much for dealing with these changes and requests.
After your PR gets merged, I plan to do a release.
Keeping child nodes that in turn gets parsed recursively.
I think I managed to do the rebasing correctly! Hope this looks good :) |
Terrific job @poacher2k. And thanks for the PR! I'll be doing a release another time because I just did one for 11770d9. |
Awesome, thank you! Probably wouldn't have learned about (super-useful) squashing and rebasing hadn't it been for this. Cheers! |
- Update README (#17 and #21): - Improve documentation of `replace` option with the help of @poacher2k - Tidy and reword some parts - Use webpack to build UMD bundle (#22) - Build to `./dist/` directory before publish - Fix regex bug on client parser (#24) - Add test for `window.DOMParser`
Add example to
README.md
to show use case wherechildren
needs to be kept or has its own handler in thereplace
method.