|
@@ -11,7 +11,10 @@ export default function defaultProcess(code){
|
|
|
const imageRegex = /<<='(?:<center>)?<img (?:'\+\(QSP\.\$set_imgh\[0\]\)\+' )?src="([\w\s/]+\.jpg)">(?:<\/center>)?'>>/gi;
|
|
|
twineCodeTemp = twineCode;
|
|
|
while(regexResult = imageRegex.exec(twineCode)) {
|
|
|
- twineCodeTemp = twineCodeTemp.replace(regexResult[0],`<<image '${regexResult[1]}'>>`);
|
|
|
+ let imagePath = regexResult[1];
|
|
|
+ if(imagePath.startsWith('images/') && imagePath.length > 7)
|
|
|
+ imagePath = imagePath.substring(7);
|
|
|
+ twineCodeTemp = twineCodeTemp.replace(regexResult[0],`<<image '${imagePath}'>>`);
|
|
|
}
|
|
|
twineCode = twineCodeTemp;
|
|
|
|