mirror of
https://gitee.com/mafgwo/stackedit
synced 2024-11-15 19:22:27 +08:00
渲染问题bugfix
This commit is contained in:
parent
d175557ab9
commit
57931b9db2
|
@ -217,8 +217,8 @@ const editorSvc = Object.assign(new Vue(), editorSvcDiscussions, editorSvcUtils,
|
|||
];
|
||||
|
||||
Array.prototype.slice.call(sectionPreviewElt.getElementsByTagName('a')).forEach((aElt) => {
|
||||
const url = aElt.attributes.href.nodeValue;
|
||||
if (url.indexOf('http://') >= 0 || url.indexOf('https://') >= 0 || url.indexOf('#') >= 0) {
|
||||
const url = aElt.attributes && aElt.attributes.href && aElt.attributes.href.nodeValue;
|
||||
if (!url || url.indexOf('http://') >= 0 || url.indexOf('https://') >= 0 || url.indexOf('#') >= 0) {
|
||||
return;
|
||||
}
|
||||
aElt.href = 'javascript:void(0);'; // eslint-disable-line no-script-url
|
||||
|
|
|
@ -93,8 +93,8 @@ export default {
|
|||
|
||||
// 替换相对路径图片为blob图片
|
||||
const imgs = Array.prototype.slice.call(containerElt.getElementsByTagName('img')).map((imgElt) => {
|
||||
let uri = imgElt.attributes.src.nodeValue;
|
||||
if (uri.indexOf('http://') !== 0 && uri.indexOf('https://') !== 0) {
|
||||
let uri = imgElt.attributes && imgElt.attributes.href && imgElt.attributes.href.nodeValue;
|
||||
if (uri && uri.indexOf('http://') !== 0 && uri.indexOf('https://') !== 0) {
|
||||
uri = decodeURIComponent(uri);
|
||||
imgElt.removeAttribute('src');
|
||||
return { imgElt, uri };
|
||||
|
|
Loading…
Reference in New Issue
Block a user