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

feat:优化下载样式

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