mirror of
https://github.com/Doodle3D/Doodle3D-Transform.git
synced 2024-07-01 05:51:24 +02:00
12 lines
336 B
JavaScript
12 lines
336 B
JavaScript
|
import { platform } from 'src/js/constants/envs.js';
|
||
|
|
||
|
export function processContent(text) {
|
||
|
if (platform === 'ios-app') text = makeImagesRelative(text);
|
||
|
return text;
|
||
|
}
|
||
|
|
||
|
const MAKE_IMAGES_RELATIVE_REG_EXP = /src="\/([^"]+)"/g;
|
||
|
function makeImagesRelative(text) {
|
||
|
return text.replace(MAKE_IMAGES_RELATIVE_REG_EXP, 'src="./$1"');
|
||
|
}
|