mirror of https://github.com/fantasticit/think.git
fix: ?<= not work at safari
parent
159ed5f799
commit
4c071a5573
|
@ -18,9 +18,9 @@ export * from './markdown-source-map';
|
||||||
const extractImage = (html) => {
|
const extractImage = (html) => {
|
||||||
let matches = [];
|
let matches = [];
|
||||||
|
|
||||||
while ((matches = html.match(/(?<=\<p.*?\>)\<img(.|\s)*?\>(?=\<\/p\>)/g))) {
|
while ((matches = html.match(/\<p.*?\>\<img(.|\s)*?\>\<\/p\>/g))) {
|
||||||
const source = html.match(/\<p.*?\>\<img(.|\s)*?\>\<\/p\>/g)[0];
|
const target = matches[0].match(/<img.*?>/)[0];
|
||||||
html = html.replace(source, matches[0]);
|
html = html.replace(matches[0], target);
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
|
Loading…
Reference in New Issue