Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/** @jsx h */
/* eslint-disable react/jsx-key */
const Html = require('slate-html-serializer').default
const { JSDOM } = require('jsdom') // eslint-disable-line import/no-extraneous-dependencies
const html = new Html({
parseHtml: JSDOM.fragment,
rules: [
{
deserialize(el, next) {
switch (el.tagName.toLowerCase()) {
case 'blockquote':
return {
object: 'block',
type: 'quote',
nodes: next(el.childNodes),
}
case 'p': {
return {
object: 'block',
type: 'paragraph',
nodes: next(el.childNodes),
/** @jsx h */
/* eslint-disable react/jsx-key */
const Html = require('slate-html-serializer').default
const React = require('react')
const h = require('../../helpers/h')
const { JSDOM } = require('jsdom') // eslint-disable-line import/no-extraneous-dependencies
const html = new Html({
parseHtml: JSDOM.fragment,
rules: [
{
serialize(obj, children) {
switch (obj.object) {
case 'block': {
switch (obj.type) {
case 'paragraph':
return React.createElement('p', {}, children)
case 'quote':
return React.createElement('blockquote', {}, children)
}
}
case 'mark': {
switch (obj.type) {
case 'bold':