提交 6b2cdc97 编写于 作者: 璃白.'s avatar 璃白. 🌻

feat:优化下载样式

上级 5bf9b825
无法预览此类型文件
此差异已折叠。
无法预览此类型文件
{
"name": "markdown-editor",
"description": " A open source markdown editor of csdn codechina team contributed",
"version": "0.7.3",
"version": "0.7.4",
"publisher": "guoweijia",
"scripts": {
"start": "webpack serve --mode=development",
......
......@@ -231,7 +231,7 @@ export default {
originalText,
selectionInfo,
"\n![file](",
`${url} '${name} ${size}')\n`
`${url.replace(/\s/g, "%20")} '${name} ${size}')\n`
);
_this.text = newText;
_this.$refs.mdUploadFile.value = "";
......
import marked from "marked";
import videojs from "video.js";
import "video.js/dist/video-js.min.css";
// import videojs from "video.js";
// import "video.js/dist/video-js.min.css";
// 获取选中文本信息
export function getSelectionInfo(selectorId) {
......
......@@ -72,15 +72,15 @@ export default {
</div>
</div>`;
}
if (text === "video") {
return `<video
class="video-js"
controls
preload="auto"
data-setup='{}'>
<source src="${href}" type="video/mp4"></source>
</video>`;
}
// if (text === "video") {
// return `<video
// class="video-js"
// controls
// preload="auto"
// data-setup='{}'>
// <source src="${href}" type="video/mp4"></source>
// </video>`;
// }
// ![img](...)渲染图片
let out = '<img src="' + href + '" alt="' + text + '"';
if (title) {
......@@ -89,20 +89,20 @@ export default {
out += "/>";
return out;
},
link(href, title, text) {
console.log(href, title, text);
// link(href, title, text) {
// console.log(href, title, text);
if (href === null) {
return text;
}
// if (href === null) {
// return text;
// }
let out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"';
}
out += ">" + text + "</a>";
return out;
},
// let out = '<a href="' + href + '"';
// if (title) {
// out += ' title="' + title + '"';
// }
// out += ">" + text + "</a>";
// return out;
// },
text(text) {
const newText = text.replace(/(\@\S+\s{0,1})/g, function(val) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册