提交 34665141 编写于 作者: 郭维嘉

feat:优化链接渲染规则&过滤行内style

上级 d3636759
无法预览此类型文件
无法预览此类型文件
......@@ -31,12 +31,6 @@
<button id="a">111111</button>
<button id="b">2222222</button>
<script src="./markdown-editor.js"></script>
<script>
console.log("send");
ipcRenderer.send("token", 1);
</script>
<script>
// setTimeout(() => {
try {
......@@ -108,24 +102,24 @@
height: 400,
// rows: 'auto',
// height: 40,
// toolsOptions: {
// // call: true,
// format: true,
// bold: true,
// italic: true,
// quote: true,
// code: true,
// link: true,
// ul: true,
// ol: true,
// task: true,
// table: true,
// img: true,
// file: true,
// test1: true,
// // help: false,
// fullScreen: true
// },
toolsOptions: {
// call: true,
format: true,
bold: true,
italic: true,
quote: true,
code: true,
link: true,
ul: true,
ol: true,
task: true,
table: true,
img: false,
file: false,
test1: true,
// help: false,
fullScreen: true
},
zIndex: 7000,
// maxLength: 20000,
showWordLimit: true,
......
此差异已折叠。
{
"name": "awesome-markdown-editor",
"description": " A open source markdown editor of csdn codechina team contributed",
"version": "0.9.2",
"version": "0.9.3",
"publisher": "guoweijia",
"scripts": {
"start": "webpack serve --mode=development",
......
......@@ -419,7 +419,6 @@ export function renderLinkCard(title, item) {
case "title":
content = `<span class="md_link_url">${title || item.title || ""}</span>`;
break;
default:
case "link":
content = `<span class="md_link_url">${item.url}</span>`;
break;
......@@ -449,6 +448,8 @@ export function renderLinkCard(title, item) {
</span>
</span></div>`;
break;
default:
content = `<span class="md_link_url">${title || item.url}</span>`;
}
return content;
}
......
......@@ -75,6 +75,9 @@ textarea {
.md_img_container {
text-align: center;
img[align="center"] {
display: inline-block;
}
}
.md_flex_card {
......
......@@ -33,7 +33,8 @@ export default {
"textarea",
"form",
"button"
]
],
FORBID_ATTR: ["style"]
}); // 去除标签
const filteredTags = getFilteredTags(html, cleanHtml); // 计算是否有标签被过滤
// 链接转换为卡片
......@@ -101,9 +102,9 @@ export default {
if (reg_align.exec(title)) {
var a = reg_align.exec(title)[2];
if (a === "center") {
out += 'style="display:inline-block;"';
}
// if (a === "center") {
// out += 'style="display:inline-block;"';
// }
out += ' align="' + a + '"';
}
if (reg_width.exec(title)) {
......
......@@ -14,7 +14,7 @@ export default {
typeStr = linkTypeSpiltStr + "title";
break;
case 2:
typeStr = linkTypeSpiltStr + "link";
// typeStr = linkTypeSpiltStr + "link";
break;
case 3:
typeStr = linkTypeSpiltStr + "3";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册