Skip to content

Instantly share code, notes, and snippets.

@levvsha
Created June 27, 2018 10:28
Show Gist options
  • Save levvsha/b2216700e9b5e97278a7b7101e4a9b78 to your computer and use it in GitHub Desktop.
Save levvsha/b2216700e9b5e97278a7b7101e4a9b78 to your computer and use it in GitHub Desktop.
...
import converter from './converter';
...
logMarkup() {
const markup = converter(this.state.editorState.getCurrentContent()); // <-- [1]
document.getElementById('js-markup-container').innerHTML = markup;
console.log('markup ==> ', markup); // <-- [2]
const sliders = document.querySelectorAll('.js-slider');// <-- [3]
_forEach(sliders, slider => {
const description = slider.innerHTML;
slider.innerHTML = ''; // eslint-disable-line
render(( <-- [4]
<ContentSlider
slides={JSON.parse(slider.getAttribute('data-slides').replace(/'/g, '"'))}
descriptionHtml={description}
/>
), slider);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment