提交 d7433ea0 编写于 作者: 璃白.'s avatar 璃白. 🌻

feat:优化卡片样式

上级 65c635e5
无法预览此类型文件
"use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[19],{6790:(e,n,l)=>{l.d(n,{Z:()=>s});var r=l(1522),i=l.n(r)()((function(e){return e[1]}));i.push([e.id,"/*\n\nDark style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>\n\n*/\n.md_preview .md_hljs {\n color: #ddd;\n background: #444;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-literal,\n.md_preview .hljs-section,\n.md_preview .hljs-link {\n color: white;\n}\n.md_preview .hljs-subst {\n /* default */\n}\n.md_preview .hljs-string,\n.md_preview .hljs-title,\n.md_preview .hljs-name,\n.md_preview .hljs-type,\n.md_preview .hljs-attribute,\n.md_preview .hljs-symbol,\n.md_preview .hljs-bullet,\n.md_preview .hljs-built_in,\n.md_preview .hljs-addition,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-tag,\n.md_preview .hljs-template-variable {\n color: #d88;\n}\n.md_preview .hljs-comment,\n.md_preview .hljs-quote,\n.md_preview .hljs-deletion,\n.md_preview .hljs-meta {\n color: #777;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-literal,\n.md_preview .hljs-title,\n.md_preview .hljs-section,\n.md_preview .hljs-doctag,\n.md_preview .hljs-type,\n.md_preview .hljs-name,\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n",""]);const s=i},2019:(e,n,l)=>{l.r(n),l.d(n,{default:()=>d});var r=l(7574),i=l.n(r),s=l(6790);i()(s.Z,{insert:"head",singleton:!1});const d=s.Z.locals||{}}}]);
\ No newline at end of file
"use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[707],{6490:(e,n,l)=>{l.d(n,{Z:()=>s});var r=l(1522),i=l.n(r)()((function(e){return e[1]}));i.push([e.id,"/*\n\nLightfair style (c) Tristian Kelly <tristian.kelly560@gmail.com>\n\n*/\n.md_preview .md_hljs {\n color: #444;\n background: var(--md-editor-code-bg-color);\n}\n.md_preview .hljs-name {\n color: #01a3a3;\n}\n.md_preview .hljs-tag,\n.md_preview .hljs-meta {\n color: #778899;\n}\n.md_preview .hljs-subst {\n /* default */\n}\n.md_preview .hljs-comment {\n color: #888888;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-attribute,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-meta .hljs-keyword,\n.md_preview .hljs-doctag,\n.md_preview .hljs-name {\n font-weight: bold;\n}\n.md_preview .hljs-type,\n.md_preview .hljs-string,\n.md_preview .hljs-number,\n.md_preview .hljs-selector-id,\n.md_preview .hljs-selector-class,\n.md_preview .hljs-quote,\n.md_preview .hljs-template-tag,\n.md_preview .hljs-deletion {\n color: #4286f4;\n}\n.md_preview .hljs-title,\n.md_preview .hljs-section {\n color: #4286f4;\n font-weight: bold;\n}\n.md_preview .hljs-regexp,\n.md_preview .hljs-symbol,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-variable,\n.md_preview .hljs-link,\n.md_preview .hljs-selector-attr,\n.md_preview .hljs-selector-pseudo {\n color: #bc6060;\n}\n.md_preview .hljs-literal {\n color: #62bcbc;\n}\n.md_preview .hljs-built_in,\n.md_preview .hljs-bullet,\n.md_preview .hljs-code,\n.md_preview .hljs-addition {\n color: #25c6c6;\n}\n.md_preview .hljs-meta .hljs-string {\n color: #4d99bf;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n",""]);const s=i},2707:(e,n,l)=>{l.r(n),l.d(n,{default:()=>d});var r=l(7574),i=l.n(r),s=l(6490);i()(s.Z,{insert:"head",singleton:!1});const d=s.Z.locals||{}}}]); "use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[705],{4596:(e,n,l)=>{l.d(n,{Z:()=>s});var r=l(1522),i=l.n(r)()((function(e){return e[1]}));i.push([e.id,"/*\n\nLightfair style (c) Tristian Kelly <tristian.kelly560@gmail.com>\n\n*/\n.md_preview .md_hljs {\n color: #444;\n background: var(--md-editor-code-bg-color);\n}\n.md_preview .hljs-name {\n color: #01a3a3;\n}\n.md_preview .hljs-tag,\n.md_preview .hljs-meta {\n color: #778899;\n}\n.md_preview .hljs-subst {\n /* default */\n}\n.md_preview .hljs-comment {\n color: #888888;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-attribute,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-meta .hljs-keyword,\n.md_preview .hljs-doctag,\n.md_preview .hljs-name {\n font-weight: bold;\n}\n.md_preview .hljs-type,\n.md_preview .hljs-string,\n.md_preview .hljs-number,\n.md_preview .hljs-selector-id,\n.md_preview .hljs-selector-class,\n.md_preview .hljs-quote,\n.md_preview .hljs-template-tag,\n.md_preview .hljs-deletion {\n color: #4286f4;\n}\n.md_preview .hljs-title,\n.md_preview .hljs-section {\n color: #4286f4;\n font-weight: bold;\n}\n.md_preview .hljs-regexp,\n.md_preview .hljs-symbol,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-variable,\n.md_preview .hljs-link,\n.md_preview .hljs-selector-attr,\n.md_preview .hljs-selector-pseudo {\n color: #bc6060;\n}\n.md_preview .hljs-literal {\n color: #62bcbc;\n}\n.md_preview .hljs-built_in,\n.md_preview .hljs-bullet,\n.md_preview .hljs-code,\n.md_preview .hljs-addition {\n color: #25c6c6;\n}\n.md_preview .hljs-meta .hljs-string {\n color: #4d99bf;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n",""]);const s=i},7705:(e,n,l)=>{l.r(n),l.d(n,{default:()=>d});var r=l(7574),i=l.n(r),s=l(4596);i()(s.Z,{insert:"head",singleton:!1});const d=s.Z.locals||{}}}]);
\ No newline at end of file \ No newline at end of file
"use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[452],{7650:(e,n,l)=>{l.d(n,{Z:()=>i});var r=l(1522),s=l.n(r)()((function(e){return e[1]}));s.push([e.id,"/*\n\nAtom One Dark by Daniel Gamage\nOriginal One Dark Syntax theme from https://github.com/atom/one-dark-syntax\n\nbase: #282c34\nmono-1: #abb2bf\nmono-2: #818896\nmono-3: #5c6370\nhue-1: #56b6c2\nhue-2: #61aeee\nhue-3: #c678dd\nhue-4: #98c379\nhue-5: #e06c75\nhue-5-2: #be5046\nhue-6: #d19a66\nhue-6-2: #e6c07b\n\n*/\n.md_preview .md_hljs {\n color: #abb2bf;\n background: #282c34;\n}\n.md_preview .hljs-comment,\n.md_preview .hljs-quote {\n color: #5c6370;\n font-style: italic;\n}\n.md_preview .hljs-doctag,\n.md_preview .hljs-keyword,\n.md_preview .hljs-formula {\n color: #c678dd;\n}\n.md_preview .hljs-section,\n.md_preview .hljs-name,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-deletion,\n.md_preview .hljs-subst {\n color: #e06c75;\n}\n.md_preview .hljs-literal {\n color: #56b6c2;\n}\n.md_preview .hljs-string,\n.md_preview .hljs-regexp,\n.md_preview .hljs-addition,\n.md_preview .hljs-attribute,\n.md_preview .hljs-meta .hljs-string {\n color: #98c379;\n}\n.md_preview .hljs-attr,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-variable,\n.md_preview .hljs-type,\n.md_preview .hljs-selector-class,\n.md_preview .hljs-selector-attr,\n.md_preview .hljs-selector-pseudo,\n.md_preview .hljs-number {\n color: #d19a66;\n}\n.md_preview .hljs-symbol,\n.md_preview .hljs-bullet,\n.md_preview .hljs-link,\n.md_preview .hljs-meta,\n.md_preview .hljs-selector-id,\n.md_preview .hljs-title {\n color: #61aeee;\n}\n.md_preview .hljs-built_in,\n.md_preview .hljs-title.class_,\n.md_preview .hljs-class .hljs-title {\n color: #e6c07b;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n.md_preview .hljs-link {\n text-decoration: underline;\n}\n",""]);const i=s},4452:(e,n,l)=>{l.r(n),l.d(n,{default:()=>t});var r=l(7574),s=l.n(r),i=l(7650);s()(i.Z,{insert:"head",singleton:!1});const t=i.Z.locals||{}}}]); "use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[718],{4673:(e,n,l)=>{l.d(n,{Z:()=>i});var r=l(1522),s=l.n(r)()((function(e){return e[1]}));s.push([e.id,"/*\n\nAtom One Dark by Daniel Gamage\nOriginal One Dark Syntax theme from https://github.com/atom/one-dark-syntax\n\nbase: #282c34\nmono-1: #abb2bf\nmono-2: #818896\nmono-3: #5c6370\nhue-1: #56b6c2\nhue-2: #61aeee\nhue-3: #c678dd\nhue-4: #98c379\nhue-5: #e06c75\nhue-5-2: #be5046\nhue-6: #d19a66\nhue-6-2: #e6c07b\n\n*/\n.md_preview .md_hljs {\n color: #abb2bf;\n background: #282c34;\n}\n.md_preview .hljs-comment,\n.md_preview .hljs-quote {\n color: #5c6370;\n font-style: italic;\n}\n.md_preview .hljs-doctag,\n.md_preview .hljs-keyword,\n.md_preview .hljs-formula {\n color: #c678dd;\n}\n.md_preview .hljs-section,\n.md_preview .hljs-name,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-deletion,\n.md_preview .hljs-subst {\n color: #e06c75;\n}\n.md_preview .hljs-literal {\n color: #56b6c2;\n}\n.md_preview .hljs-string,\n.md_preview .hljs-regexp,\n.md_preview .hljs-addition,\n.md_preview .hljs-attribute,\n.md_preview .hljs-meta .hljs-string {\n color: #98c379;\n}\n.md_preview .hljs-attr,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-variable,\n.md_preview .hljs-type,\n.md_preview .hljs-selector-class,\n.md_preview .hljs-selector-attr,\n.md_preview .hljs-selector-pseudo,\n.md_preview .hljs-number {\n color: #d19a66;\n}\n.md_preview .hljs-symbol,\n.md_preview .hljs-bullet,\n.md_preview .hljs-link,\n.md_preview .hljs-meta,\n.md_preview .hljs-selector-id,\n.md_preview .hljs-title {\n color: #61aeee;\n}\n.md_preview .hljs-built_in,\n.md_preview .hljs-title.class_,\n.md_preview .hljs-class .hljs-title {\n color: #e6c07b;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n.md_preview .hljs-link {\n text-decoration: underline;\n}\n",""]);const i=s},7718:(e,n,l)=>{l.r(n),l.d(n,{default:()=>t});var r=l(7574),s=l.n(r),i=l(4673);s()(i.Z,{insert:"head",singleton:!1});const t=i.Z.locals||{}}}]);
\ No newline at end of file \ No newline at end of file
"use strict";(self.webpackChunkmarkdown_editor=self.webpackChunkmarkdown_editor||[]).push([[721],{3386:(e,n,l)=>{l.d(n,{Z:()=>s});var r=l(1522),i=l.n(r)()((function(e){return e[1]}));i.push([e.id,"/*\n\nDark style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>\n\n*/\n.md_preview .md_hljs {\n color: #ddd;\n background: #444;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-literal,\n.md_preview .hljs-section,\n.md_preview .hljs-link {\n color: white;\n}\n.md_preview .hljs-subst {\n /* default */\n}\n.md_preview .hljs-string,\n.md_preview .hljs-title,\n.md_preview .hljs-name,\n.md_preview .hljs-type,\n.md_preview .hljs-attribute,\n.md_preview .hljs-symbol,\n.md_preview .hljs-bullet,\n.md_preview .hljs-built_in,\n.md_preview .hljs-addition,\n.md_preview .hljs-variable,\n.md_preview .hljs-template-tag,\n.md_preview .hljs-template-variable {\n color: #d88;\n}\n.md_preview .hljs-comment,\n.md_preview .hljs-quote,\n.md_preview .hljs-deletion,\n.md_preview .hljs-meta {\n color: #777;\n}\n.md_preview .hljs-keyword,\n.md_preview .hljs-selector-tag,\n.md_preview .hljs-literal,\n.md_preview .hljs-title,\n.md_preview .hljs-section,\n.md_preview .hljs-doctag,\n.md_preview .hljs-type,\n.md_preview .hljs-name,\n.md_preview .hljs-strong {\n font-weight: bold;\n}\n.md_preview .hljs-emphasis {\n font-style: italic;\n}\n",""]);const s=i},721:(e,n,l)=>{l.r(n),l.d(n,{default:()=>d});var r=l(7574),i=l.n(r),s=l(3386);i()(s.Z,{insert:"head",singleton:!1});const d=s.Z.locals||{}}}]);
\ No newline at end of file
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
value: value:
"## edswgdfgdfgdfg\n**dfgdfgdfg**\n_ergdfgdfg_\n> ergergdfg\n```\nwefgdfsfdgdf\n```\n- efwefsdfsdf\n\n\nsdgfdfgdfgdfg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg", "## edswgdfgdfgdfg\n**dfgdfgdfg**\n_ergdfgdfg_\n> ergergdfg\n```\nwefgdfsfdgdf\n```\n- efwefsdfsdf\n\n\nsdgfdfgdfgdfg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg\n\n\nedrfgdfgdfg\n\n\n\nergergergergerg\nergergergerg",
value: value:
"![](https://img2.baidu.com/it/u=4025475678,645544065&fm=26&fmt=auto&gp=0.jpg '')", "[1](https://img2.baidu.com/it/u=4025475678,645544065&fm=26&fmt=auto&gp=0.jpg)\n[](https://img2.baidu.com/it/u=4025475678,645544065&fm=26&fmt=auto&gp=0.jpg)",
// value: "当前问题已结题,不再开放新的回答。", // value: "当前问题已结题,不再开放新的回答。",
// value: "", // value: "",
disabled: false, disabled: false,
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
ol: true, ol: true,
task: true, task: true,
table: true, table: true,
img: true,
file: true, file: true,
// help: false, // help: false,
fullScreen: true fullScreen: true
...@@ -156,33 +157,39 @@ ...@@ -156,33 +157,39 @@
}); });
}, },
renderLinks: function(val, callback) { renderLinks: function(val, callback) {
const newLinks = val.map(item => {
item.csdn = true;
item.title =
"指定的可执行文件cmd.exe未能运行,某某函数不正确-后端-CSDN问答";
item.img = "https://g.csdnimg.cn/static/logo/favicon32.ico";
item.desc =
"CSDN问答为您找到指定的可执行文件cmd.exe未能运行,某某函数不正确相关问题答案,如果想了解更多关于指定的可执行文件cmd.exe未能运行,某某函数不正确 asp.net、c# 技术问题等相关问答,请访问CSDN问答。";
return item;
});
setTimeout(() => { setTimeout(() => {
callback(newLinks); val[0].title = "111111";
val[0].icon = "https://g.csdnimg.cn/static/logo/favicon32.ico";
callback(val);
}, 1000); }, 1000);
setTimeout(() => {
val[1].title = "2222222";
val[1].icon = "https://g.csdnimg.cn/static/logo/favicon32.ico";
callback(val);
}, 2000);
setTimeout(() => {
val[1].title = "333333333";
val[1].icon = "https://img2.baidu.com/it/u=4025475678,645544065&fm=26&fmt=auto&gp=0.jpg)\n[](https://img2.baidu.com/it/u=4025475678,645544065&fm=26&fmt=auto&gp=0.jpg";
callback(val);
}, 3000);
}, },
queryUserList: function(val, callback) { queryUserList: function(val, callback) {
const list = [ const list = [
{ {
id: 1, id: 1,
nickname: "藤原拓海", nickname: "cpongo1",
username: 'cpongo1', username: "cpongo1",
url: "https://weibo.com/u/5492443184", url: "https://weibo.com/u/5492443184",
avatar: avatar:
"https://img2.baidu.com/it/u=2380211986,3979961921&fm=26&fmt=auto&gp=0.jpg" "https://img2.baidu.com/it/u=2380211986,3979961921&fm=26&fmt=auto&gp=0.jpg"
}, },
{ {
id: 2, id: 2,
nickname: "高桥凉介", nickname: "CPongo2",
username: 'cpongo2', username: "cpongo2",
url: "https://weibo.com/u/5492443184", url: "https://weibo.com/u/5492443184",
avatar: avatar:
"https://img0.baidu.com/it/u=777620324,2343967729&fm=26&fmt=auto&gp=0.jpg" "https://img0.baidu.com/it/u=777620324,2343967729&fm=26&fmt=auto&gp=0.jpg"
...@@ -190,7 +197,7 @@ ...@@ -190,7 +197,7 @@
{ {
id: 3, id: 3,
nickname: "马奎斯", nickname: "马奎斯",
username: 'cpongo3', username: "cpongo3",
url: "https://weibo.com/u/5492443184", url: "https://weibo.com/u/5492443184",
avatar: avatar:
"https://img2.baidu.com/it/u=1297316011,1869565258&fm=26&fmt=auto&gp=0.jpg" "https://img2.baidu.com/it/u=1297316011,1869565258&fm=26&fmt=auto&gp=0.jpg"
...@@ -198,7 +205,7 @@ ...@@ -198,7 +205,7 @@
{ {
id: 4, id: 4,
nickname: "王一博", nickname: "王一博",
username: 'cpongo4', username: "cpongo4",
url: "https://weibo.com/u/5492443184", url: "https://weibo.com/u/5492443184",
avatar: avatar:
"https://img2.baidu.com/it/u=298051053,3773223854&fm=26&fmt=auto&gp=0.jpg" "https://img2.baidu.com/it/u=298051053,3773223854&fm=26&fmt=auto&gp=0.jpg"
...@@ -206,7 +213,7 @@ ...@@ -206,7 +213,7 @@
{ {
id: 5, id: 5,
nickname: "王俊凯", nickname: "王俊凯",
username: 'cpongo5', username: "cpongo5",
url: "https://weibo.com/tfwangjunkai", url: "https://weibo.com/tfwangjunkai",
avatar: avatar:
"https://img1.baidu.com/it/u=2378425879,2273515018&fm=26&fmt=auto&gp=0.jpg" "https://img1.baidu.com/it/u=2378425879,2273515018&fm=26&fmt=auto&gp=0.jpg"
...@@ -214,7 +221,7 @@ ...@@ -214,7 +221,7 @@
{ {
id: 6, id: 6,
nickname: "易烊千玺", nickname: "易烊千玺",
username: 'cpongo6', username: "cpongo6",
url: "https://weibo.com/tfyiyangqianxi", url: "https://weibo.com/tfyiyangqianxi",
avatar: avatar:
"https://img0.baidu.com/it/u=2227200088,1939721201&fm=26&fmt=auto&gp=0.jpg" "https://img0.baidu.com/it/u=2227200088,1939721201&fm=26&fmt=auto&gp=0.jpg"
...@@ -222,7 +229,7 @@ ...@@ -222,7 +229,7 @@
{ {
id: 7, id: 7,
nickname: "白敬亭", nickname: "白敬亭",
username: 'cpongo7', username: "cpongo7",
url: "https://weibo.com/u/2112496475", url: "https://weibo.com/u/2112496475",
avatar: avatar:
"https://img1.baidu.com/it/u=3265411836,2089649447&fm=11&fmt=auto&gp=0.jpg" "https://img1.baidu.com/it/u=3265411836,2089649447&fm=11&fmt=auto&gp=0.jpg"
......
此差异已折叠。
无法预览此类型文件
{ {
"name": "markdown-editor", "name": "markdown-editor",
"description": " A open source markdown editor of csdn codechina team contributed", "description": " A open source markdown editor of csdn codechina team contributed",
"version": "0.7.2", "version": "0.7.3",
"publisher": "guoweijia", "publisher": "guoweijia",
"scripts": { "scripts": {
"start": "webpack serve --mode=development", "start": "webpack serve --mode=development",
......
...@@ -398,28 +398,27 @@ export default { ...@@ -398,28 +398,27 @@ export default {
}); });
}, },
renderLinksHtml({ vDom, links }) { renderLinksHtml({ vDom, links }) {
new Promise((resolve, reject) => { const _this = this;
this.$emit("renderLinks", { this.$emit("renderLinks", {
links, links,
callback: function(list) { callback: function(list) {
resolve(list); list.forEach(item => {
} // item.csdn = true;
}); const linkEl = vDom.querySelector("#" + item.id);
}).then(res => { if (!linkEl) return;
res.forEach(item => { const url = item.csdn
item.csdn = true; ? "https://link.csdn.net/?target=" + item.url
const linkEl = vDom.querySelector("#" + item.id); : item.url;
const url = item.csdn // linkEl.id = "md_link_card";
? "https://link.csdn.net/?target=" + item.url linkEl.className = "md_link_card";
: item.url; linkEl.setAttribute("target", "_blank");
linkEl.id = "md_link_card"; linkEl.setAttribute("href", url);
linkEl.className = "md_link_card"; const title = getLinkTitle(linkEl, item);
linkEl.setAttribute("target", "_blank");
linkEl.setAttribute("href", url); linkEl.innerHTML = renderLinkCard(title, item);
const title = getLinkTitle(linkEl); });
linkEl.innerHTML = renderLinkCard(title, item); _this.html = vDom.innerHTML;
}); }
this.html = vDom.innerHTML;
}); });
} }
} }
......
...@@ -190,7 +190,14 @@ export function checktUrl(val, rule) { ...@@ -190,7 +190,14 @@ export function checktUrl(val, rule) {
hideEl.style.display = "none"; hideEl.style.display = "none";
hideEl.innerHTML = val; hideEl.innerHTML = val;
const imgList = Array.from(hideEl.getElementsByTagName("img")); const imgList = Array.from(hideEl.getElementsByTagName("img"));
return imgList.filter(item => !rule.test(item.src)).map(item => item.src); // const icoRule = /http[s]:\/\/.+\.ico/;
return imgList.filter(item => {
// return !rule.test(item.src) && !icoRule.test(item.src);
return (
!rule.test(item.src) &&
item.getAttribute("referrerpolicy") !== "no-referrer"
);
});
} }
export function checkBoswer() { export function checkBoswer() {
...@@ -362,7 +369,7 @@ export function getLinkTags(id, html) { ...@@ -362,7 +369,7 @@ export function getLinkTags(id, html) {
const links = Array.from( const links = Array.from(
virtualDom.querySelectorAll("a:not([download])") virtualDom.querySelectorAll("a:not([download])")
).map((item, index) => { ).map((item, index) => {
item.id = id + "_" + index; item.id = id + "_" + new Date().getTime() + "_" + index;
return { return {
id: item.id, id: item.id,
title: item.innerText, title: item.innerText,
...@@ -372,23 +379,23 @@ export function getLinkTags(id, html) { ...@@ -372,23 +379,23 @@ export function getLinkTags(id, html) {
return { vDom: virtualDom, links }; return { vDom: virtualDom, links };
} }
export function getLinkTitle(linkEl) { export function getLinkTitle(linkEl, item) {
const title = linkEl.innerText; const originTitle = linkEl.innerText;
return /^http/.test(title) ? "" : title; const titleEl = Array.from(linkEl.getElementsByClassName("md_link_title"));
if (titleEl.length) return item.title || titleEl[0].innerText;
return /^http/.test(originTitle) ? "" : originTitle;
} }
export function renderLinkCard(title, item) { export function renderLinkCard(title, item) {
return ` return `
<span class="md_link_title">${title || item.title || ""}</span> <span class="md_link_title">${title || item.title || ""}</span>
${ ${`<span class="md_link_desc" style="${
item.description item.description ? "" : "margin: 0px 0 2px"
? `<span class="md_link_desc">${item.description}</span>` }">${item.description || ""}</span>`}
: ""
}
<span class="md_flex_card"> <span class="md_flex_card">
${ ${
item.icon item.icon
? `<img class="md_link_img" src="${item.icon}" />` ? `<img class="md_link_img" referrerpolicy="no-referrer" id="md_link_img" src="${item.icon}" />`
: "<span class='md_link_img icon iconfont icon-lianjie'></span>" : "<span class='md_link_img icon iconfont icon-lianjie'></span>"
} }
<span class="flex-1"> <span class="flex-1">
......
...@@ -20,10 +20,12 @@ ...@@ -20,10 +20,12 @@
span { span {
color: var(--md-editor-text-color-active); color: var(--md-editor-text-color-active);
} }
.md_link_img { .md_link_img,
#md_link_img {
height: 14px !important; height: 14px !important;
line-height: 14px !important; line-height: 14px !important;
margin-right: 10px; margin: 0 !important;
margin-right: 8px !important;
border-radius: 2px; border-radius: 2px;
} }
.md_link_title { .md_link_title {
...@@ -39,8 +41,8 @@ ...@@ -39,8 +41,8 @@
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
color: var(--md-editor-text-color); color: var(--md-editor-text-color);
margin: 6px 0 8px;
line-height: 20px; line-height: 20px;
margin: 6px 0 8px;
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
...@@ -48,6 +50,7 @@ ...@@ -48,6 +50,7 @@
} }
.md_link_url { .md_link_url {
font-size: 13px; font-size: 13px;
line-height: 1.2 !important;
color: var(--md-editor-border-color-active); color: var(--md-editor-border-color-active);
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
margin: 0 auto; margin: 0 auto;
} }
p { p {
font-size: 18px; font-size: 16px;
color: var(--md-editor-text-color-active); color: var(--md-editor-text-color-active);
font-weight: 400; font-weight: 400;
line-height: 26px !important; line-height: 26px !important;
......
...@@ -230,13 +230,13 @@ export default { ...@@ -230,13 +230,13 @@ export default {
startStr: "", startStr: "",
endStr: "" endStr: ""
}, },
// { {
// name: "file", name: "file",
// icon: "wenjian", icon: "wenjian",
// tip: "上传附件", tip: "上传附件",
// startStr: "", startStr: "",
// endStr: "" endStr: ""
// }, },
{ {
name: "task", name: "task",
icon: "renwu", icon: "renwu",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册