yzhang-gh / vscode-markdown Goto Github PK
View Code? Open in Web Editor NEWMarkdown All in One
Home Page: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
License: MIT License
Markdown All in One
Home Page: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
License: MIT License
Tab doesn't indent task list items like it does with bulleted/numbered lists. Ctrl + ] or [ does work, however.
Happened to see this article. Good comments!
reuse npm modules
// extension host makes it always accessible to extensions:
var vscode = require('vscode');
//...
const getMarkdownPlugin = function () {
const extension = vscode.extensions.getExtension("Microsoft.vscode-markdown");
if (!extension) return;
extensionPath = path.join(extension.extensionPath, "node_modules", "/");
const named = require(extensionPath + "markdown-it-named-headers");
const md = require(extensionPath + "markdown-it")()
.set({ html: true, breaks: true, typographer: true })
.use(named);
return md;
}; //getMarkdownPlugin
const md = getMarkdownPlugin();
// now we can use md to render HTML
//...
claim built-in markdown extension as dependencies
"extensionDependencies": [
"Microsoft.vscode-markdown"
]
Not an issue just a discussion on convention. Why is the default "markdown.extension.orderedList.marker": "one"
when naturally most people would think ordered list are increasing in order? Either way I don't see why someone would use "one"
(inspire me)
This behavior is very weird to me:
1. Item 1 #press enter
1. Item 2
Of course I can just change the setting. But default settings should functional, convenient, conventional, and then popular opinion.
For
- item1
It's very convenient to get this when hit return
- item1
-
But for
- [ ] task 1
hit return
can only get
- [ ] task 1
-
It would be very desirable to get this
- [ ] task 1
- [ ]
From #49 @ketozhang
tab should only refer to listing environment such that:
# snippet tabCompletion is active here but not listing tab * Item 1 * Item 1a #listing tab is active here but not tabCompletion
Since we override the tab key, we need to handle all cases by ourselves. The current behavior is
if (inListEnv) {
exec('indent')
} else {
exec('tab')
}
We can change it to
if (inListEnv && someConditions) {
exec('indent')
} else if (otherConditions) {
exec('editor.action.triggerSuggest')
} else {
exec('tab')
}
I am a little busy recently, will return to it in several days.
When I have a header with a list beneath it containing links it seems to think it is a TOC (marking it as not up to date) and regenerating a TOC in place on saving. You should be able to save without it creating TOC's.
Example:
## Tasks
- [A task](http://link-to-task)
- [Another task](http://link-to-another-task)
On saving this is replaced by a TOC of the entire document.
Edit
Got it disabled using:
"markdown.extension.toc.updateOnSave": false
However it's still strange it detected a TOC here.
When opening VS Code with a workspace containing a large number of files and the Markdown All in One extension enabled, the searchService process started by VS Code consumes a lot of CPU cycles for several minutes, which unnecessarily drains battery power.
The process consuming the CPU has the following command arguments:
C:\programs\editors\vscode\Code.exe c:\programs\editors\vscode\resources\app\out\bootstrap --type=searchService
When Markdown All in One is disabled, VS Code consumes very few CPU cycles on startup. I think the source of the heavy CPU usage is the "workspaceContains" activation event:
"activationEvents": [
"onLanguage:markdown"
"workspaceContains:*.md"
]
If I remove the workspaceContains event and leave just the "onLanguage:markdown" event, the extension is very light on startup.
"activationEvents": [
"onLanguage:markdown"
]
With the "workspaceContains:*.md" activation event, the extension is so heavy on CPU, I have to disable it or modify the package.json if I want to use it.
Windows 10, x64.
Visual Studio Code ver 1.14.1.
Shell 1.6.6.
Renderer 56.0.2924.87.
Node 7.4.0.
Markdown All in One - Yu Zhang v0.7.5.
Computer it is running on is 7 days old and all software is freshly installed.
Installing the extension for the first time followed by a reload of VS Code, then editing a Markdown (.md
) file caused VS Code to spam keyboard input hook errors on the top address bar (cannot recall exact error messages). After uninstall and reinstalling followed by another VS Code reload, the keyboard hook errors have gone away but the extension has no effect on Markdown (.md
) files. It is as if the extension is disabled yet it is not.
Hi.
if i enable the extension Version 0.5.1, and enable preview of an markdown file, the Preview 'Tab' replaces the current file. If i am select 'Preview Side By Side' the Editor split, the Preview opens on the right side, and after one second, the Preview is the current Tab and the orginal markdown file is closed.
If i disable this Plugin, this behavior disappear.
Using vscode 1.12.0-insider 2017-04-14
PS: Previous version of this extension does not show this.
When using the Shift + Alt + F short cut on a table that contains escaped pipe character ( \| ) the extensions realigns them as if they were standard column delimiters ( | ). The formatter should treat these escaped pipes the same as regular characters
steps to reproduce
{
"math inline" : {
"prefix": "$",
"body": ["$`$1`$"],
"description": "inline math"
}
}
Hello there,
Your extension has some problems with Unikey.
Unikey worked well if I disabled your extension.
The bug happened when I tried to type Vietnamese with Unikey.
As I typed "Mo65t" (Unikey will convert to "Một"), the text in markdown file replaced it to Mot.
Can you show me where the function to replace the text is?
I'm running Visual Studio Code x64 1.15.1 with Markdown All in One 0.8.3. When generating a ToC for my repository's README file (linking a specific commit here for archiving purposes in case I change the header format in the future), the ToC is incomplete and only contains links to headers where I used #
to mark a line as header. It looks like this:
- [Via cloud service](#via-cloud-service)
- [AppVeyor](#appveyor)
- [Travis CI](#travis-ci)
- [Docker Cloud](#docker-cloud)
- [Locally](#locally)
- [FDD + SCD + Chocolatey package + AppImage](#fdd-scd-chocolatey-package-appimage)
- [Small footprint SCD](#small-footprint-scd)
- [Docker image](#docker-image)
- [FDD](#fdd)
- [SCD](#scd)
- [Docker container](#docker-container)
- [Chocolatey package](#chocolatey-package)
- [AppImage](#appimage)
As you can see from the original README (linked above), all h1 and h2 headers are missing.
Most Markdown flavors, including GFM and CommonMark support writing headers not only with leading #
(for h1) and ##
(for h2), but also with a new line consisting of any number of =
(for h1) or any number of -
(for h2) though. The CommonMark spec calls these "setext heading underline", see CommonMark Spec - setext heading
Example:
# Sharp h1
## Sharp h2
Underline h1
========
Underline h2
-------------
When I was editing a markdown file, I need preview. But when I switch to another editor(such as a js code editor) I hope no markdown preview window appear.
So I hope when I switch to another editor, the markdown preview editr(window) can be closed automatically. If I switch back to the markdown editor, the preview window is opened to side again.
Can you implement that?
提交”handle activation events by hand"使得没有打开workspace时无法工作,
例如,按回车键报类似找不到对应的触发函数的错误
Translated:
v0.7.4 won't work when a single file (rather than a folder) is opened.
w|ord
-> press Ctrl+B -> **w|ord**
As more and more functionalities are added, we need unit tests to make our life easier.
When I save this file it tries to turn it into a table which isn't what I want. This bug should be fixed but more importantly there should be a setting for this plugin not to change the file at all automatically. There's a setting for that but just for the TOC, not for everything.
## heading
- one
- this is `|two|`
- three
show outline on sidebar.
| | |
| --- | --- |
| | |
If I print the current markdown into an HTML file and send it to one of my colleges, that do not have VS Code installed, the HTML looks like crap because the CSS files in there are references to files on my local machine.
<link rel="stylesheet" type="text/css" href="file:///c%3A/Users/butzl/.vscode/extensions/yzhang.markdown-all-in-one-0.11.1/media/markdown.css">
<link rel="stylesheet" type="text/css" href="file:///c%3A/Users/butzl/.vscode/extensions/yzhang.markdown-all-in-one-0.11.1/media/tomorrow.css">
<link rel="stylesheet" type="text/css" href="file:///c%3A/Users/butzl/.vscode/extensions/yzhang.markdown-all-in-one-0.11.1/media/checkbox.css">
I think it would be great if the information from the file would be included into the HTML file. If this would be implemented, the HTML would also be independent from the used plugin version in VS Code.
vs code error:
command 'markdown.extension.onEnterKey' not found
command 'markdown.extension.onTabKey' not found
command 'markdown.extension.onBackspaceKey' not found
Hi, was wondering if one could add more markdown expander buttons in the top right bar, right now there's a bold, italic, strikethrough, and list buttons, I'd like to add buttons for code, headings, etc, but also some not standard like for highlighting things, a button that when clicked it would add <mark>text</mark>
around the selected text, is that possible? Thanks
Excellent extension and thank you for taking the time to build it! I curious if you could make the scroll sync work whether I'm scrolling over the .md
file OR the preview. Scrolling syncs fine when mouse is over the preview tab, but when I want to scroll thru for edits in the .md
side the preview side remains static. Maybe I have this configured incorrectly or there is a setting? Any advice is appreciated!
Would be good to have a user setting to use _underscore for italics_
.
The fix implemented in 0.11.1 to use tab/backspace to indent/outdent task lists seems to have broken the behaviour of tab, backspace and enter in normal editing mode. I.E. When not on a task list.
Pressing any of these keys throws a warning 'command markdown.extension,onbackspacekey not found',etc. and the action is not performed.
If I disable the extension and reload the editor page then the keys work as expected.
It limits the extension's usefulness. Was this really the intended behaviour of tab, backspace and entered with the extension. Thanks.
Just editing a large markdown file with a number of fenced code blocks (mine also include a language specifier) and, while editing one of those code blocks, I have noticed the extension trying to insert bullet points, and interfering with indentation when I press enter to go to a new line.
I'd suggest that the extension should try to detect if it's currently inside of a fenced code block and avoid further processing, instead deferring to normal editor behaviour until the cursor leaves the fenced code area.
The when
clause at https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesviews might help I guess.
The ideal UX, in my opinion, is what pasting detects URL from the clipboard and does its magic. For example, before paste:
After paste:
The next preferred method is a keyboard shortcut like here on GitHub. I select text, press a keyboard shortcut (Ctrl+K would be ideal but that one is taken by VSCode so probably Ctrl+L which is the second most popular shortcut for MD links in various editors) and get this:
I can then paste the URL which is in my clipboard.
Thanks for this awesome extension!
UPDATE 06/2019 for anyone reading this:
Ctrl+L
/ Cmd+L
to insert links, one can define a custom snippet in keybindings.json
: #20 (comment)This:
# `make` targets
gets converted to this broken link in table of contents:
- [`make` targets](#`make`-targets)
I believe it should be:
- [`make` targets](#make-targets)
I would like to hide/remove the "Outline view in explorer panel" feature.
Is there any settings for this?
It seems like the last update is triggering an error whenever VSCode is opened or when I open a file.
Here are the stacktraces:
messageService.ts:125 Cannot read property 'filter' of null: TypeError: Cannot read property 'filter' of null at MdOutlineProvider.getChildren (/Users/Damien/.vscode/extensions/yzhang.markdown-all-in-one-0.10.1/out/src/toc.js:242:28) at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:257200 at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:63276 at new n.Class.derive._oncancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:48394) at Object.t.asWinJsPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:63239) at t.getTreeItems (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:257152) at e.$getElements (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:256203) at t.e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:423958) at e._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:280554) at e._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:280244) at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:279271 at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:281190 at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:56058 at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:55287) at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:57078) at Socket. (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:102495) e.doShow @ messageService.ts:125 e.show @ messageService.ts:104 (anonymous) @ mainThreadTreeViews.ts:71 v @ winjs.base.raw.js:1209 enter @ winjs.base.raw.js:901 _run @ winjs.base.raw.js:1068 _error @ winjs.base.raw.js:1041 e.resolveErr @ lazyPromise.ts:77 e._receiveOneMessage @ rpcProtocol.ts:68 (anonymous) @ rpcProtocol.ts:32 (anonymous) @ rpcProtocol.ts:157 e.invoke @ callbackList.ts:63 e.fire @ event.ts:123 (anonymous) @ ipc.net.ts:82 emitOne @ events.js:96 emit @ events.js:191 readableAddChunk @ _stream_readable.js:178 Readable.push @ _stream_readable.js:136 onread @ net.js:560
Please return an array of children.: Error: Please return an array of children. at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:204908 at Object.g [as _notify] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:52522) at Object.enter (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:56594) at n.Class.derive._oncancel._run (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:57915) at n.Class.derive._oncancel._error (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:57432) at e.resolveErr (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:2434911) at e._receiveOneMessage (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:2436272) at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:2435600 at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:2437519 at e.invoke (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:28:66905) e.onUnexpectedError @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:29
I know how frustrating it can be to get an error report just after a release 😅 Keep up the good work on the extension though! ❤️
I format one table which contains Chinese characters will appear this issue.
One Chinese character will take 2 English character space in table.
We can put 2 space for Chinese table for blank.
OSI中的层 | 功能 | TCP/IP协议族 |
---|---|---|
应用层 | 文件传输,电子邮件,文件服务,虚拟终端 | TFTP,HTTP,SNMP,FTP,SMTP,DNS,Telnet |
表示层 | 数据格式化,代码转换,数据加密 | 没有协议 |
会话层 | 解除或建立与别的接点的联系 | 没有协议 |
传输层 | 提供端对端的接口 | TCP,UDP |
网络层 | 为数据包选择路由 | IP,ICMP,RIP,OSPF,BGP,IGMP |
数据链路层 | 传输有地址的帧以及错误检测功能 | SLIP,CSLIP,PPP,ARP,RARP,MTU |
物理层 | 以二进制数据形式在物理媒体上传输数据 | ISO2110,IEEE802,IEEE802.2 |
I understand why you wouldn't want the keyboard shortcuts to be changing for files that aren't Markdown, but regardless, README.md and the Overview page should mention this requirement. I would also like a option, perhaps disabled by default, to allow this extension to work on .txt files as well.
Thanks for this great extension!
To make editing list easier, this extension overrides the Enter key behavior (by adding a Enter keyboard shortcut which will call onEnterKey
).
But the Enter key behavior is not fully re-implemented (the indentation rules). Maybe I should investigate how vscode deals with the Enter key.
For example,
## Visit example.com
Will get ID of visit-examplecom
by GitHub but this extension will generate a ToC link of
[Visit example.com](#visit-example-com)
I didn't do an extensive research about how all the possible ToC plugins behave but I've observer the non-dash behavior at least on GitHub, in marky-markdown and in Caret.
For
1. list
1. backspace before me
press backspace
before b will produce
1. list
1. backspace before me
That's great. But, for
1. list
1. backspace before me
now press backspace
before b will produce
1. list
backspace before me
That isn't what it should be, user just want to delete a extra space
When I rename the first heading used by the TOC, the engine does not recognize the TOC anymore.
I know one of the measures to find the table is to match the first item. However, maybe one could extend this behaviour such that if the first item was not found, try to match the second.
Greetings! I'd love to have a keyboard shortcut for strikethrough (for crossing off list items)
Looking through the source code it looks like you can duplicate/modify formatting.ts
// Copy this function
function toggleBold() {
return styleByWrapping('**');
}
// Rename and change the constant to '~~'. Something like
function toggleStrikethrough() {
return styleByWrapping('~~');
}
I'd love to submit a PR, but I am not familiar with this dev environment. Seems simple enough (from my perspective), assuming binding a keystroke is also as straight forward. If you have the time, I'd love to have this. Thanks
Quite a common use case for me is moving items in ordered lists. In the end, I might end up with something like:
1. Lorem ipsum
3. Dolor sit amet
2. Etc.
This obviously gets much worse in larger lists, e.g., instructions for something. It would be nice if the numbering could be fixed automatically by this extension.
作者qq.com暴露了是国人, 所以直接飙中文啦
希望可以添加toc里的链接不转码的选项, 以及支持大小写,
现在如果我标题里有大写, 生成的toc是小写的
I install markdown-all-in-one in my VSC and restart it. But when I open a .md file, it can't show preview automatically.
I usually want to skip H1 heading from table of contents and only care about levels 2..x. For example, I'd appreciate being able to set this:
"markdown.extension.toc.levels": "2..6"
This would probably replace the current markdown.extension.toc.depth
setting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.