Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38536878
Awesome-Markdown-Editor
提交
c478b01f
Awesome-Markdown-Editor
项目概览
qq_38536878
/
Awesome-Markdown-Editor
与 Fork 源项目一致
Fork自
gitcode_dev / Awesome-Markdown-Editor
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Awesome-Markdown-Editor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c478b01f
编写于
9月 02, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:优化选择链接展示样式表示
上级
e84da320
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
21 deletion
+18
-21
src/App.vue
src/App.vue
+3
-0
src/assets/js/utils.js
src/assets/js/utils.js
+2
-2
src/components/content/md-textarea.vue
src/components/content/md-textarea.vue
+6
-0
src/components/content/mixins/render-mixins.js
src/components/content/mixins/render-mixins.js
+3
-3
src/components/content/mixins/select-link-type-mixins.js
src/components/content/mixins/select-link-type-mixins.js
+4
-16
未找到文件。
src/App.vue
浏览文件 @
c478b01f
...
...
@@ -453,6 +453,8 @@ export default {
},
renderLinksHtml
({
vDom
,
links
})
{
const
_this
=
this
;
console
.
log
(
links
);
this
.
$emit
(
"
renderLinks
"
,
{
links
,
callback
:
function
(
list
)
{
...
...
@@ -464,6 +466,7 @@ export default {
?
"
https://link.csdn.net/?target=
"
+
item
.
url
:
item
.
url
;
// linkEl.className = "md_link_card";
item
.
linkType
=
linkEl
.
getAttribute
(
"
data-type
"
);
linkEl
.
setAttribute
(
"
target
"
,
"
_blank
"
);
linkEl
.
setAttribute
(
"
href
"
,
url
);
const
title
=
getLinkTitle
(
linkEl
,
item
);
...
...
src/assets/js/utils.js
浏览文件 @
c478b01f
...
...
@@ -369,11 +369,9 @@ export function getLinkTags(id, html) {
virtualDom
.
querySelectorAll
(
"
a:not([download])
"
)
).
map
((
item
,
index
)
=>
{
item
.
id
=
id
+
"
_
"
+
new
Date
().
getTime
()
+
"
_
"
+
index
;
const
linkType
=
item
.
getAttribute
(
"
data-type
"
);
return
{
id
:
item
.
id
,
title
:
item
.
innerText
,
linkType
,
url
:
item
.
href
};
});
...
...
@@ -466,3 +464,5 @@ export function getfilesize(size) {
return
(
size
/
Math
.
pow
(
num
,
3
)).
toFixed
(
2
)
+
"
G
"
;
//G
return
(
size
/
Math
.
pow
(
num
,
4
)).
toFixed
(
2
)
+
"
T
"
;
//T
}
export
const
linkTypeSpiltStr
=
"
/%ra
"
;
src/components/content/md-textarea.vue
浏览文件 @
c478b01f
...
...
@@ -437,6 +437,12 @@ export default {
)
)
return
;
const
cursorPoint
=
getPosition
(
this
.
id
);
const
prefixStr
=
this
.
textContent
.
slice
(
cursorPoint
-
str
.
length
-
5
,
cursorPoint
-
str
.
length
);
if
(
prefixStr
.
includes
(
"
src=
"
))
return
;
this
.
createSelectLinkTypeDialog
();
});
...
...
src/components/content/mixins/render-mixins.js
浏览文件 @
c478b01f
...
...
@@ -3,7 +3,7 @@ import {
getLinkTags
,
addLanguageClass
,
addLinkTarget
,
renderVideo
,
linkTypeSpiltStr
,
getfilesize
}
from
"
@/assets/js/utils
"
;
import
marked
from
"
marked
"
;
...
...
@@ -121,10 +121,10 @@ export default {
if
(
href
===
null
)
{
return
text
;
}
const
linkTypeArr
=
href
.
split
(
"
::
"
);
const
linkTypeArr
=
href
.
split
(
linkTypeSpiltStr
);
const
linkType
=
linkTypeArr
[
1
];
href
=
linkTypeArr
[
0
];
text
=
text
.
split
(
"
::
"
)[
0
];
text
=
text
.
split
(
linkTypeSpiltStr
)[
0
];
let
invalidText
=
""
;
if
(
href
===
text
)
{
const
invalidRule
=
/
[
)】}
\]]
*$/
;
...
...
src/components/content/mixins/select-link-type-mixins.js
浏览文件 @
c478b01f
import
{
getPosition
,
formatText
}
from
"
@/assets/js/utils
"
;
import
{
getPosition
,
formatText
,
linkTypeSpiltStr
}
from
"
@/assets/js/utils
"
;
export
default
{
methods
:
{
handleSelectLinkType
(
index
)
{
...
...
@@ -11,10 +11,10 @@ export default {
case
0
:
break
;
case
1
:
typeStr
=
"
::
1
"
;
typeStr
=
linkTypeSpiltStr
+
"
1
"
;
break
;
case
2
:
typeStr
=
"
::
2
"
;
typeStr
=
linkTypeSpiltStr
+
"
2
"
;
break
;
default
:
break
;
...
...
@@ -71,23 +71,11 @@ export default {
left
:
pEl
.
offsetLeft
<
frameWidth
*
(
2
/
3
)
?
pEl
.
offsetLeft
:
pEl
.
offsetLeft
-
20
0
,
:
pEl
.
offsetLeft
-
14
0
,
top
:
pEl
.
offsetTop
-
textEl
.
scrollTop
};
textEl
.
parentNode
.
removeChild
(
hideEl
);
// this.queryInfo.startPosition = getPosition(this.id) + 1;
// this.queryInfo.endPosition = getPosition(this.id) + 1;
// if (type === "android") {
// this.queryInfo.startPosition--;
// this.queryInfo.endPosition--;
// }
// this.$emit("queryUserList", this.queryInfo.keyWord);
this
.
$nextTick
(()
=>
{
// const userList = this.userList;
// if (userList === false) return;
// if (this.queryInfo.keyWord === "") {
// this.allUserList = userList;
// }
this
.
showSelectLinkType
=
true
;
this
.
$nextTick
(()
=>
{
const
list
=
textEl
.
parentNode
.
querySelector
(
"
.md_select_user
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录