|
@@ -2,7 +2,7 @@ function parseMd(content) {
|
|
|
var frontMatters = [];
|
|
|
var blockArray = [{title: ''}];
|
|
|
var blockCount;
|
|
|
- var preDataIndex, imgDataIndex;
|
|
|
+ var preDataIndex;
|
|
|
var parseBlockDiv;
|
|
|
var url;
|
|
|
var preImg, preImgObject;
|
|
@@ -69,12 +69,12 @@ function parseMd(content) {
|
|
|
} else if (line.includes('amp-img')) {
|
|
|
const preBlockindex = blockCount;
|
|
|
if (line.includes('</amp-img>')) {
|
|
|
- blockArray = addDataToBlockArray(preImgObject, blockArray, preBlockindex, imgDataIndex);
|
|
|
+ blockArray = addDataToBlockArray(preImgObject, blockArray, preBlockindex, preDataIndex - 1);
|
|
|
isAmpImgRange = false;
|
|
|
preImgObject = {'image': {}}
|
|
|
continue;
|
|
|
}
|
|
|
- imgDataIndex = preDataIndex;
|
|
|
+ const imgDataIndex = preDataIndex;
|
|
|
preDataIndex += 1;
|
|
|
isAmpImgRange = true;
|
|
|
const {img, imgInput, widthInput, heightInput, imgInputButton} = getImgElements(parseBlockDiv);
|