Update README with advanced usage of replace method#17
Update README with advanced usage of replace method#17remarkablemark merged 1 commit intoremarkablemark:masterfrom poacher2k:master
replace method#17Conversation
|
@poacher2k Thanks for the pull request! I'm thinking about making a directory What are your thoughts? |
README.md
Outdated
| style: { fontSize: '42px' } }, | ||
| parsedChildren); | ||
| // equivalent jsx syntax: | ||
| // return <span key={key} style={{ fontSize: '42px' }}>{parsedChildren}</span>; |
There was a problem hiding this comment.
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! |
README.md
Outdated
| 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.
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.mdto show use case wherechildrenneeds to be kept or has its own handler in thereplacemethod.