Medium-to-Ghost processing: Check for title-skipping only once
If we've already skipped the title, no need to go on searching for it again. We'll probably end up missing some subheadings or something
This commit is contained in:
parent
2131d76fd5
commit
38b5a8ec5d
1 changed files with 4 additions and 2 deletions
|
@ -132,7 +132,7 @@ const pushToGhost = async (postSlug) => {
|
|||
|
||||
const outStream = fs.createWriteStream(postOutput, { encoding: 'utf-8' })
|
||||
|
||||
let titleSkipped = false;
|
||||
var titleSkipped = false;
|
||||
|
||||
let reImage = new RegExp('^!\\[(.*)\\]\\((\\S+?)\\)(.*)')
|
||||
let reTitle = new RegExp('^#\ .*')
|
||||
|
@ -144,7 +144,9 @@ const pushToGhost = async (postSlug) => {
|
|||
var newLine = line
|
||||
|
||||
// Skip the header
|
||||
if (!titleSkipped && await reTitle.exec(line)) return
|
||||
if (!titleSkipped && await reTitle.exec(line)) {
|
||||
titleSkipped = true
|
||||
}
|
||||
|
||||
// check for images
|
||||
var m = await reImage.exec(line)
|
||||
|
|
Loading…
Reference in a new issue