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

fix:优化link格式

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