Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
npm-debug.log
.idea
node_modules
dist/
coverage/
lib/
coverage/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A utility for converting HTML strings into [React](https://facebook.github.io/re
## Install

```
npm install react-html-parser
npm install https://github.com/Budgee/react-html-parser.git
```

## Usage
Expand All @@ -27,4 +27,4 @@ class HtmlComponent extends React.Component {
return <div>{ ReactHtmlParser(html) }</div>;
}
}
```
```
4 changes: 2 additions & 2 deletions demo/src/js/components/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function Content(props) {
const { html, onUpdateClick } = props;
return (
<main id="content">
<Editor initialHtml={ html } onUpdateClick={ onUpdateClick } />
<Html html={ html } />
<Editor initialHtml={html} onUpdateClick={onUpdateClick} />
<Html html={html} />
</main>
);
}
Expand Down
10 changes: 4 additions & 6 deletions demo/src/js/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import AceEditor from 'react-ace';

import 'sass/editor';

export default class Editor extends Component {
class Editor extends Component {
constructor(props) {
super();
this.state = {
Expand Down Expand Up @@ -36,15 +36,15 @@ export default class Editor extends Component {
<AceEditor mode="html"
theme="chrome"
name="HTML_EDITOR"
value={ html }
value={html}
width="100%"
height="auto"
onChange={this.onChange}
onLoad={this.onEditorLoad}
editorProps={ editorProps }
editorProps={editorProps}
/>
<div className="buttons">
<button onClick={ () => onUpdateClick(html) }>Update HTML</button>
<button onClick={() => onUpdateClick(html)}>Update HTML</button>
</div>
</div>
);
Expand All @@ -55,5 +55,3 @@ Editor.propTypes = {
initialHtml: PropTypes.string.isRequired,
onUpdateClick: PropTypes.func.isRequired
};

export default Editor;
2 changes: 1 addition & 1 deletion demo/src/js/components/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Html(props) {
const { html } = props;
return (
<div id="html">
{ ReactHtmlParser(html) }
{ReactHtmlParser(html)}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/js/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class App extends React.Component {
return (
<div id="app">
<Header />
<Content onUpdateClick={ html => dispatch(updateHtml(html)) } html={ html } />
<Content onUpdateClick={html => dispatch(updateHtml(html))} html={html} />
</div>
);
}
Expand Down
Loading