substance
Version:
Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).
19 lines (17 loc) • 515 B
JavaScript
import { DocumentSchema } from 'substance'
import TestArticle from './TestArticle'
import getTestConfig from './getTestConfig'
export default function createTestArticle (seedFn) {
let config = getTestConfig()
let schema = new DocumentSchema({
DocumentClass: TestArticle,
nodes: config.getNodes(),
// TODO: try to get rid of this by using property schema
defaultTextType: 'paragraph'
})
let doc = TestArticle.createEmptyTestArticle(schema)
if (seedFn) {
seedFn(doc)
}
return doc
}