First pass at hero section.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
|
||||
module.exports.contentAsText = async function(doc, rootLevel) {
|
||||
module.exports.contentAsText = async function(doc, rootLevel, includeCurrent = false) {
|
||||
const { level, next, line, head } = doc
|
||||
const linesAsArray = []
|
||||
|
||||
let contentDepth = -1
|
||||
if (includeCurrent) linesAsArray.push(line())
|
||||
let contentDepth = includeCurrent ? level() : -1
|
||||
|
||||
while(await next(rootLevel)) {
|
||||
if (contentDepth === -1 && !!line()) contentDepth = level()
|
||||
|
||||
Reference in New Issue
Block a user