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

fix:优化link格式

上级 e8ed23bd
......@@ -231,13 +231,15 @@ export default {
case "italic":
case "quote":
case "code":
case "link":
case "ul":
case "task":
case "table":
case "call":
this.$emit("updateText", { startStr, endStr });
break;
case "link":
this.$emit("updateText", { startStr, endStr, type });
break;
case "format":
this.$emit("setFormatType", { lock: false });
break;
......
......@@ -199,7 +199,7 @@ export default {
icon: "aite",
tip: "@关注的人",
startStr: "@",
endStr: "",
endStr: ""
},
{
name: "headline",
......@@ -249,8 +249,8 @@ export default {
icon: "lianjie",
tip: "添加链接",
doc: "[标题](链接)",
startStr: "[](",
endStr: ")"
startStr: "[",
endStr: "]()"
},
{
name: "ul",
......@@ -420,10 +420,11 @@ export default {
newText.slice(e, newText.length);
}
}
const len =
let len =
selectionInfo.selectionEnd -
selectionInfo.selectionStart +
startStr.length;
if (type === "link") len += 2;
this.updateText(newText, len);
if (startStr === "@") {
setTimeout(() => {
......
......@@ -9,8 +9,9 @@ module.exports = {
devServer: {
contentBase: path.resolve(__dirname, "dist"),
host: "0.0.0.0",
port: 443,
https: true,
port: '80',
// port: 443,
// https: true,
open: true
},
resolve: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册