Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GaleTeng
Awesome-Markdown-Editor
提交
449c7d35
Awesome-Markdown-Editor
项目概览
GaleTeng
/
Awesome-Markdown-Editor
与 Fork 源项目一致
Fork自
gitcode_dev / Awesome-Markdown-Editor
通知
1
Star
1
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,发现更多精彩内容 >>
提交
449c7d35
编写于
8月 23, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
a492e2d3
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
190 addition
and
8 deletion
+190
-8
src/App.vue
src/App.vue
+1
-1
src/assets/style/font/iconfont.ttf
src/assets/style/font/iconfont.ttf
+0
-0
src/assets/style/iconfont.less
src/assets/style/iconfont.less
+15
-0
src/assets/style/markdown.less
src/assets/style/markdown.less
+1
-1
src/components/content/components/help-doc.vue
src/components/content/components/help-doc.vue
+16
-1
src/components/content/mixins/render-mixins.js
src/components/content/mixins/render-mixins.js
+26
-4
src/components/header/components/headline-select.vue
src/components/header/components/headline-select.vue
+97
-0
src/components/header/components/tool-button.vue
src/components/header/components/tool-button.vue
+27
-1
src/components/header/md-header.vue
src/components/header/md-header.vue
+7
-0
未找到文件。
src/App.vue
浏览文件 @
449c7d35
...
...
@@ -216,7 +216,7 @@ export default {
originalText
,
selectionInfo
,
"
\n
![img](
"
,
`
${
url
}
'
${
name
}
')\n`
`
${
url
}
'
=600 #left
')\n`
);
_this
.
text
=
newText
;
_this
.
$refs
.
mdUploadFile
.
value
=
""
;
...
...
src/assets/style/font/iconfont.ttf
浏览文件 @
449c7d35
无法预览此类型文件
src/assets/style/iconfont.less
浏览文件 @
449c7d35
...
...
@@ -122,3 +122,18 @@
.icon-shipin:before {
content: "\e63c";
}
.icon-biaoti:before {
content: "\e78a";
}
.icon-sijibiaoti:before {
content: "\e603";
}
.icon-wujibiaoti:before {
content: "\e675";
}
.icon-liujibiaoti:before {
content: "\e676";
}
src/assets/style/markdown.less
浏览文件 @
449c7d35
...
...
@@ -15,7 +15,7 @@
}
img {
max-width: 100%;
height: auto;
//
height: auto;
&.right {
border: 1px solid #ccc;
float: right;
...
...
src/components/content/components/help-doc.vue
浏览文件 @
449c7d35
...
...
@@ -68,7 +68,22 @@ export default {
},
{
title
:
"
图片
"
,
doc
:
'
![alt](url "title")
'
,
doc
:
"
![alt](url)
"
,
icon
:
"
tupian
"
},
{
title
:
"
图片大小
"
,
doc
:
'
![alt](url "=300x200")
'
,
icon
:
"
tupian
"
},
{
title
:
"
图片位置
"
,
doc
:
'
![alt](url "#left")
'
,
icon
:
"
tupian
"
},
{
title
:
"
图片名称
"
,
doc
:
'
![alt](url "%title")
'
,
icon
:
"
tupian
"
},
{
...
...
src/components/content/mixins/render-mixins.js
浏览文件 @
449c7d35
...
...
@@ -77,19 +77,41 @@ export default {
class="video-js"
controls
src="
${
href
}
"
/
>`
;
></video
>`
;
}
// ![img](...)渲染图片
let
out
=
'
<img src="
'
+
href
+
'
" alt="
'
+
text
+
'
"
'
;
if
(
title
)
{
out
+=
'
title="
'
+
title
+
'
"
'
;
const
reg_title
=
/
(\%([\u
4E00-
\u
9FA5
\w
.
]
+
)\s??)
/
;
const
reg_align
=
/
(\#([
a-zA-Z
]
+
)\s??)
/
;
const
reg_width
=
/
(\=(\d
+
)\*?\s??)
/
;
const
reg_height
=
/
([\*
|x
](\d
+
)\s??)
/
;
if
(
reg_title
.
exec
(
title
))
{
var
t
=
reg_title
.
exec
(
title
)[
2
];
out
+=
'
title="
'
+
t
+
'
"
'
;
}
if
(
reg_align
.
exec
(
title
))
{
var
a
=
reg_align
.
exec
(
title
)[
2
];
if
(
a
===
"
center
"
)
{
out
+=
'
style="display:block;margin: 0 auto;"
'
;
}
out
+=
'
align="
'
+
a
+
'
"
'
;
}
if
(
reg_width
.
exec
(
title
))
{
var
w
=
reg_width
.
exec
(
title
)[
2
];
out
+=
'
width="
'
+
w
+
'
px"
'
;
}
if
(
reg_height
.
exec
(
title
))
{
var
h
=
reg_height
.
exec
(
title
)[
2
];
out
+=
'
height="
'
+
h
+
'
px"
'
;
}
}
out
+=
"
/>
"
;
return
out
;
},
link
(
href
,
title
,
text
)
{
console
.
log
(
href
,
title
,
text
);
if
(
href
===
null
)
{
return
text
;
}
...
...
src/components/header/components/headline-select.vue
0 → 100644
浏览文件 @
449c7d35
<
template
>
<div
class=
"headline_select_container"
>
<ul>
<li
@
click=
"$emit('select', index)"
v-for=
"(item, index) in list"
:key=
"index"
>
<span
:class=
"['icon iconfont', `icon-$
{item.icon}`]">
</span>
<span>
{{
item
.
title
}}
</span>
</li>
</ul>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
list
:
[
{
title
:
"
一级标题
"
,
icon
:
"
yijibiaoti
"
},
{
title
:
"
二级标题
"
,
icon
:
"
erjibiaoti
"
},
{
title
:
"
三级标题
"
,
icon
:
"
sanjibiaoti
"
},
{
title
:
"
四级标题
"
,
icon
:
"
sijibiaoti
"
},
// {
// title: "五级标题",
// icon: "wujibiaoti"
// },
// {
// title: "六级标题",
// icon: "liujibiaoti"
// }
]
};
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.headline_select_container {
position: relative;
&::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 18px;
pointer-events: none;
}
}
ul {
max-height: 150px;
overflow-y: hidden;
margin-top: 2px;
margin-bottom: 4px;
border-top: 1px solid #e1e1e1;
padding-top: 6px;
box-sizing: border-box;
scrollbar-color: transparent transparent;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
&::-webkit-scrollbar-thumb {
border-radius: 1em;
background-color: rgba(50, 50, 50, 0.3);
}
&::-webkit-scrollbar-track {
border-radius: 1em;
background-color: rgba(50, 50, 50, 0);
}
li {
cursor: pointer;
height: 24px;
line-height: 24px;
.iconfont {
display: inline-block;
vertical-align: bottom;
}
&:hover {
color: var(--md-editor-border-color-active);
}
}
}
</
style
>
src/components/header/components/tool-button.vue
浏览文件 @
449c7d35
...
...
@@ -10,6 +10,13 @@
>
<span
:class=
"['icon iconfont', `icon-$
{info.icon}`]">
</span>
</div>
<div
v-else-if=
"info.name === 'headline'"
v-tip.bottom=
"headlineOptions"
class=
"tool_button"
>
<span
:class=
"['icon iconfont', `icon-$
{info.icon}`]">
</span>
</div>
<div
v-else-if=
"info.name === 'table'"
@
click=
"handleTool(info.name, info.startStr, info.endStr)"
...
...
@@ -42,8 +49,9 @@ import codeSelect from "./code-select";
import
videoSelect
from
"
./video-select
"
;
import
tableSelect
from
"
./table-select
"
;
import
markdownDoc
from
"
./markdown-doc
"
;
import
headlineSelect
from
"
./headline-select
"
;
export
default
{
components
:
{
codeSelect
,
tableSelect
,
videoSelect
},
components
:
{
codeSelect
,
tableSelect
,
videoSelect
,
headlineSelect
},
props
:
{
info
:
{
type
:
Object
,
...
...
@@ -138,6 +146,24 @@ export default {
theme
:
this
.
darkMode
?
"
dark
"
:
"
light
"
};
},
headlineOptions
()
{
return
{
content
:
this
.
info
.
tip
,
customComponent
:
headlineSelect
,
customClass
:
"
headlineSelectDialog
"
,
width
:
110
,
customListeners
:
{
select
:
val
=>
{
this
.
closeTips
();
const
lang
=
"
#
"
.
repeat
(
val
+
1
);
this
.
handleTool
(
"
code
"
,
"
\n
"
+
lang
+
"
"
,
"
\n
"
);
}
},
zIndex
:
parseInt
(
this
.
zIndex
)
+
1
,
theme
:
this
.
darkMode
?
"
dark
"
:
"
light
"
};
},
tableOptions
()
{
return
{
content
:
this
.
info
.
tip
,
...
...
src/components/header/md-header.vue
浏览文件 @
449c7d35
...
...
@@ -163,6 +163,13 @@ export default {
tip
:
"
全屏模式
"
},
toolButtonList
:
[
{
name
:
"
headline
"
,
icon
:
"
biaoti
"
,
tip
:
"
添加标题
"
,
startStr
:
"
\n
"
,
endStr
:
"
\n
"
},
{
name
:
"
bold
"
,
icon
:
"
bold
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录