Skip to content

Commit

Permalink
This is the pull request for version 0.3.5 (#100)
Browse files Browse the repository at this point in the history
* Change default frontMatterRenderingOption to none; Change default protocolsWhiteList value

* Fix missing code_chunk_offset when only `cmd` is provided

* Set enableScriptExecution to false by default

* Add split icon for vscode mpe

* Upgrade mume to version 0.3.3

* Remove cmd:true as attribute
  • Loading branch information
shd101wyy authored Apr 15, 2018
1 parent 441cbd8 commit c1b4c42
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 154 deletions.
115 changes: 0 additions & 115 deletions docs/newest.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/welcome.md

This file was deleted.

19 changes: 19 additions & 0 deletions media/PreviewOnRightPane_16x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions media/PreviewOnRightPane_16x_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
"commands": [
{
"command": "markdown-preview-enhanced.openPreview",
"title": "Markdown Preview Enhanced: Open Preview"
"title": "Markdown Preview Enhanced: Open Preview",
"category": "Markdown",
"icon": {
"light": "./media/PreviewOnRightPane_16x.svg",
"dark": "./media/PreviewOnRightPane_16x_dark.svg"
}
},
{
"command": "markdown-preview-enhanced.toggleScrollSync",
Expand Down Expand Up @@ -128,6 +133,13 @@
"when": "editorLangId == markdown",
"group": "markdown-preview-enhanced"
}
],
"editor/title": [
{
"command": "markdown-preview-enhanced.openPreview",
"when": "editorLangId == markdown",
"group": "navigation"
}
]
},
"configuration": {
Expand Down Expand Up @@ -231,11 +243,11 @@
"description": "Front matter rendering option",
"type": "string",
"enum": [
"none",
"table",
"code block",
"none"
"code block"
],
"default": "table"
"default": "none"
},
"markdown-preview-enhanced.mermaidTheme": {
"description": "Mermaid theme, you can choose one from [\"mermaid.css\", \"mermaid.dark.css\", \"mermaid.forest.css\"]",
Expand Down Expand Up @@ -320,8 +332,8 @@
]
},
"markdown-preview-enhanced.protocolsWhiteList": {
"description": "Accepted protocols followed by `://` for links.",
"default": "http, https, atom, file",
"description": "Accepted protocols for links.",
"default": "http://, https://, atom://, file://, mailto:, tel:",
"type": "string"
},
"markdown-preview-enhanced.imageFolderPath": {
Expand Down Expand Up @@ -407,7 +419,7 @@
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"dependencies": {
"@shd101wyy/mume": "^0.3.2"
"@shd101wyy/mume": "^0.3.3"
},
"devDependencies": {
"@types/jquery": "^3.2.17",
Expand All @@ -421,4 +433,4 @@
"typescript": "^2.6.2",
"vscode": "^1.1.13"
}
}
}
6 changes: 3 additions & 3 deletions src/preview-content-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class MarkdownPreviewEnhancedView
const lineCount = editor.document.lineCount;
for (let i2 = 0; i2 < lineCount; i2++) {
const line = editor.document.lineAt(i2);
if (line.text.match(/^```(.+)\"?cmd\"?\s*[:=]/)) {
if (line.text.match(/^```(.+)\"?cmd\"?\s*[=\s}]/)) {
if (codeChunkOffset === targetCodeChunkOffset) {
i2 = i2 + 1;
while (i2 < lineCount) {
Expand All @@ -165,7 +165,7 @@ export class MarkdownPreviewEnhancedView
} else {
codeChunkOffset++;
}
} else if (line.text.match(/\@import\s+(.+)\"?cmd\"?\s*[:=]/)) {
} else if (line.text.match(/\@import\s+(.+)\"?cmd\"?\s*[=\s}]/)) {
if (codeChunkOffset === targetCodeChunkOffset) {
// console.log('find code chunk' )
return insertResult(i2, editor);
Expand Down Expand Up @@ -509,7 +509,7 @@ export class MarkdownPreviewEnhancedView
public runAllCodeChunks(sourceUri) {
const engine = this.getEngine(sourceUri);
if (engine) {
engine.runAllCodeChunks().then(() => {
engine.runCodeChunks().then(() => {
this.updateMarkdown(sourceUri);
});
}
Expand Down

0 comments on commit c1b4c42

Please sign in to comment.