GithubHelp home page GithubHelp logo

markdowneditor's Introduction

Markdown Editor

Build status

Download this extension from the VS Gallery (VS 2022) or get the CI build.


A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

See the change log for changes and road map.

Features

  • Powered by Markdig - the best markdown parser
  • Syntax highlighting
  • Live preview window with scroll sync
  • Mermaid chart support
  • CommonMark and GitHub flavored Markdown
  • High-DPI support
  • Drag 'n drop of images supported
  • Paste image from clipboard directly onto document
  • Outlining/folding of code blocks
  • Keyboard shortcuts
  • Light Bulbs
  • Brace completion with type-through
  • Lightning fast
  • Auto-generate HTML files

Syntax highlighting

All fonts can be changed in Tools -> Options -> Environment -> Fonts and Colors dialog.

Font Options

GitHub and other flavors

Advanced markdown extensions are supported to give more features to the syntax. This includes pipe tables, emoji, mathematics and a lot more.

Live Preview Window

The preview window opens up on the right side of the document when it opens.

Preview window

Every time the markdown document is modified, the preview window will update.

Any code blocks receives full syntax highlighting in the preview window. Here's an example of JavaScript code rendered.

Code Colorizing

The preview window is automatically scrolled to match the scroll position of the document. As the document is scrolled up and down, the preview window will follow.

Live preview can be disabled in the settings.

The syntax highlighter is powered by Prism

Custom stylesheets

The preview window supports loading of custom stylesheets. It will look for a file called md-styles.css in the same directory as the currently opened markdown file or any parent directory.

If no md-styles.css file is found it will look for it in %userprofile%. If it still isn't found it will use the built in stylesheet.

To generate a custom stylesheet, simply right-click inside the markdown editor document and select Add Custom Stylesheet...

Custom Stylesheet

The name of the custom stylesheet can be changed in the settings.

Preview HTML template

The preview window also supports loading of HTML template, which will be detailed in Auto-generate HTML files section.

When the markdown document is updated, the markdown editor will call onMarkdownUpdate function if it exists. With this feature, you can support your own scripts, for example KaTeX for LaTeX.

Drag 'n drop images

Drag an image directly from Solution Explorer onto the document to insert the appropriate markdown that will render the image.

Paste images

This is really helpful for copying images from a browser or for inserting screen shots. Simply copy an image into the clipboard and paste it directly into the document. This will prompt you for a file name relative to the document and then it inserts the appropriate markdown.

It will even parse the file name and make a friendly name to use for the alt text.

Outlining

Any fenced code and HTML blocks can be collapsed, so that this:

Outlining Expanded

...can be collapsed into this:

Outlining Collapsed

Keyboard shortcuts

Ctrl+B makes the selected text bold by wrapping it with **.

Ctrl+I makes the selected text italic by wrapping it with _.

Ctrl+Shift+C wraps the selected text in a code block.

Ctrl+Space checks and unchecks task list items.

- [x] task list item

Tab increases indentation of list items.

Shift+Tab decreases indentation of list items.

Ctrl+K,C wraps the selection with HTML comments.

Ctrl+K,U removes HTML comments surrounding the selection/caret.

Ctrl+PgUp moves caret to previous heading

Ctrl+PgDown moves caret to next heading

Light Bulbs

The suggested actions shown in light bulbs makes it easier to perform common tasks.

Light bulbs

For instance, converting the selected text to a link will result in this:

Light bulbs image

Auto-generate HTML files

By right-clicking any Markdown file in Solution Explorer, you can turn on automatic generation of a HTML file.

Generate HTML

It will wrap the output rendered markdown in a HTML template that looks like this:

<!DOCTYPE html>
<html>
<head>
    <title>[title]</title>
</head>
<body>

    [content]

</body>
</html>

You can provide your own HTML template by dropping a file with the name md-template.html in the same or parent folder to the markdown file. If not found, it will search %userprofile%.

Just make sure to include the [content] token in the template. And the [title] token is optional if you need a title.

Settings

Control the settings for this extension under Tools -> Options -> Text Editor -> Markdown

Options

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

markdowneditor's People

Contributors

barrynolte avatar bjornbouetsmith avatar bot-man-jl avatar efreykongcn avatar ewsoftware avatar igorushi avatar jessehardy avatar jkillingsworth avatar lsoft avatar madskristensen avatar penseleit avatar taspeotis avatar wjervis7 avatar xoofx avatar xt0rted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdowneditor's Issues

Code blocks inside list blocks render with 7 spaces instead of 8

Installed product versions

  • Visual Studio: 2015 Community
  • This extension: 1.5.110

Description

When rendering a code block that sits inside a number list, the Markdown convention is to indent with 8 spaces (instead of the usual 4), for example:

1. Here is item 1
2. Here is list item 2

        This is some code
3. Here is list item 3]

However, this extension begins to render the code block after 7 spaces, and includes the extra space as the first character in the code block.

Steps to recreate

  1. Take the text from the code block above and paste it into a Markdown file in VS.
  2. Remove 1 space before the This is some code
  3. Note it is still rendered as code.

Please support more location settings

Can you support left/top/right/bottom to locate preview window?
I used to coding in middle screen.
But now I'm always twist the neck to see the left.
Thanks.

Preview window: Body fonts are bold instead of regular

Installed product versions

  • Windows: 8.1
  • Visual Studio: 2015 Enterprise
  • This extension: 1.5.110

Description

In the preview window all fonts are bold/extra bold

Steps to recreate

  1. Just use it.
  2. Copy html to file and view with IE - same behavior.

Maybe only reproducible on certain systems.

Current behavior

Body fonts in preview are all bold

Expected behavior

Body fonts in preview are regular

Root cause

The style (highlight.css) lists Helvetica fonts in the first place, but there is only one Helvetica-Bold available on my system (maybe installed by some other software, MS Office?)
Putting "Segoe UI" or Arial in the first place fixes the problem.
Since this is an extension for a Windows application, Windows standard fonts should be listed first, else the result will be never predictable.

Other extensions not working in Markdown Editors Windows

Installed product versions

  • Visual Studio: 2015 Professional Update 2 (Windows 7)
  • This extension: 1.3.81

Description

I noticed that some other extensions are not working in Markdown editor windows, e.g. Trailing Whitespace (I checked the Ignore Pattern setting), Visual Studio Spell Checker, Visual Assist X (e.g. Highlight matching words). With Markdown Editor disabled, or with plain text files, they work, so I assume it has to do with Markdown Editor.

I donโ€™t know for sure if thatโ€™s a bug or a feature, but I wanted to let you know.

Steps to recreate

  1. Install Markdown Editor and Trailing Whitespace Visualizer
  2. Remove .md from Options / Environment / Trailing Whitespace / Ignore pattern
  3. Open or create a .md file and add trailing whitespace
  4. Optional: Install Visual Studio Spell Checker and / or other extensions and check with them.

Current behavior

Trailing whitespace is not visualized.

Expected behavior

Trailing whitespace should be visualized.

Generated HTML file alongside MD file

Installed product versions

  • Visual Studio: Community Update 3 (14.0.25425.01)
  • This extension: Markdown Editor 1.7.147

Description

After editing a Markdown file, an HTML file is generated in the same folder with the same name.

Steps to recreate

  1. Open a standalone .md file
  2. Edit
  3. Save

Allow links in preview mode to open in default web browser

Is this possible? Our code won't be published to github, and it would be nice to use the preview mode as our de facto markdown reader within VS 2015. Having clickable links would be great (without having to ctrl-click the link in the markdown editor)

First code line after list item has wrong font for opening spaces

With this markdown:

1. Some list item

        some code
        more code

The lines "some code" and "more code" are not aligned in the editor, although they are fine in the preview window. If you turn on View White Space, you can see that the first three spaces on the line "some code" are in the default font, rather than the code font.

Once you understand what is happening, it's just cosmetics, but until you do, it feels like tabs and spaces are being swapped out or other craziness is happening. This especially happens if you try to align the two lines or insert a paragraph between the list item and the code, which causes the code block to appear to have a mind of its own.

The same thing happens when using back ticks to markup text in-line.

Versions:

  • Visual Studio 2015 Enterprise Update 3
  • Markdown Editor 1.7.150

Add support for TOC navigation

It is often very convenient to navigate easily to a heading in a document. The extension should provide a way to easily access the TOC and navigate to it.

Would be also perfect if it was keyboard friendly.

Support for layouts

Markdig supports mermaid syntax.
See. xoofx/markdig#34
But for mermaid to be rendered correctly in MarkdownEditor, there needs to be an ability to reference to the mermaid javascript file in the output.
This could via layouts, like suggested in the above mentioned markdig issue. But maybe it could also be convention based, like the support for stylesheets created in MarkdownEditor 1.6?

HTML highligting

Is it possible to activate default VS HTML highlighting/classifiers on HTML span/blocks that are identified by Markdig? (to have a better highlighting experience for this case)

Allow sync navigation to be disabled per document

Discussed in issue #2

We would like to have a button in the status bar to enable/disable live sync navigation per document (in addition to the global settings). This would not be persisted, just when editing.

More hotkeys

Description

Can we get hotkeys for the "suggested actions shown in light bulbs"? Especially useful for link and image, but also for block quote and code block (ctrl-C is for in-line).

Visual Studio crashes when dragging the splitter without a project open

Installed product versions

  • Visual Studio: 2015 Community
  • This extension: 1.2.52

Description

When you don't have a solution open, but have opened a markdown file, clicking on the splitter button crashes Visual Studio.

Steps to recreate

  1. Open Visual Studio
  2. Select File -> Open -> File
  3. Select a markdown file
  4. Click (or try to drag) the splitter button above the scroll bar. Visual Studio will crash.

This is the splitter button I'm referring to:
image

This doesn't happen if you have a solution/project open. It only appears to happen when you have opened a single file.

Nothing appears in the ActivityLog.xml file, but I did attempt to "debug" it via Windows' "this application crashed, do you want to debug it?" prompt, and it came up with this error:

System.ObjectDisposedException was unhandled
Message: An unhandled exception of type 'System.ObjectDisposedException' occurred in PresentationFramework.dll
Additional information: Cannot access a disposed object.

There was no stack trace. Not sure if that's what caused the crash, or if that was just a side effect of trying to debug it.

Dead zone when preview pane is below markdown

2016-08-08 21_23_00-compiler options md - microsoft visual studio

Installed product versions

  • Visual Studio: 2015 Community Edition Update 3 (14.0.25424)
  • This extension: 1.6.141

Description

Both the markdown editor and the preview pane do not extend to the right of the available editor space.

Notes

This behavior only occurs when the preview is below the editor; when the preview is to the side of the editor this doesn't happen.
Toggling full-screen on/off didn't seem to make a difference, nor did the mode in which VS was opened (full-screen / not full screen) .
Resizing the window also didn't matter.
AFAICT, all the other Markdown Editor settings are at their defaults.

Allow to reuse full document parsing for better smart completion experience

Related to issue #7

In order to better support smart completion for nested list which need to use information from the full syntax tree instead of just analysing the current line.

This would require to store the parsed document somewhere (not only for classification or in the Browser.cs) and make it available for other commands/targets.

Check with @madskristensen how/where to do this.

Image name doesn't support Chinese.

Installed product versions

  • Visual Studio 2015
  • This extension: 1.3.81

Description

I pasted an image and saved it with a Chinese file name, and the preview can't show it.
(BTW: The Web Essential extension did support chinese file name.)

Editor font preview is Courier New instead of Consolas

Installed product versions

  • Visual Studio 2015 Community
  • This extension 1.7.150

Description

The Markdown source editor shows regular text in the Consolas font, but indented code text in the Courier New font. This cannot be changed in the settings.

Steps to recreate

  1. Type 4 spaces followed by text

Current behavior

Courier New

Expected behavior

Consolas, like every other code text in Visual Studio

Handle extensions other than .md

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: 1.6.133

Description

In Tools > Options > Text Editor > File Extension, Markdown Editor isn't in the Editor dropdown list. Is it possible to get it in there so that I can use Markdown Editor with .rst files?

Support for the flowchart as part of the markdown

Installed product versions

  • Visual Studio: Pro

Description

Can you please add support in markdown for the http://flowchart.js.org/ like in stackio online markdown editor.

UML diagrams

You can also render sequence diagrams like this:

Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!

And flow charts like this:

st=>start: Start
e=>end
op=>operation: My Operation
cond=>condition: Yes or No?

st->op->cond
cond(yes)->e
cond(no)->op

Note: You can find more information:

Error when deleting collapsed block

Installed product versions

  • Visual Studio: 2015 Community Update 3
  • This extension: 1.7.148

Description

Recieve "An exception has been encountered. This may be caused by an extension...." Error when deleting a collapsed/folded block of markdown.

Error in ActivityLog.xml

  <entry>
    <record>514</record>
    <time>2016/08/24 22:31:27.817</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.&#x000D;&#x000A;Parameter name: span&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.SnapshotSpan..ctor(ITextSnapshot snapshot, Span span)&#x000D;&#x000A;   at MarkdownEditor.Outlining.MarkdownOutliningTagger.&lt;ProcessCodeBlocks&gt;d__8.MoveNext() in C:\projects\markdowneditor\src\Outlining\MarkdownOutliningTagger.cs:line 78&#x000D;&#x000A;   at System.Linq.Enumerable.&lt;UnionIterator&gt;d__66`1.MoveNext()&#x000D;&#x000A;   at System.Linq.Enumerable.&lt;UnionIterator&gt;d__66`1.MoveNext()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.&lt;GetTagsForBuffer&gt;d__38.MoveNext()</description>
  </entry>

Steps to recreate

  1. Collapse/fold block of markdown
  2. Select collapsed/folded section
  3. Delete selection

Current behavior

VS throws an ambiguous exception message

Expected behavior

Nothing. Just delete the section of markdown and leave nothing. Without an exception message.

Can't scroll preview with keyboard

Installed product versions

  • Visual Studio: 2015 U3 Enterprise
  • This extension: 1.5.110

Description

Can't scroll the preview window with keyboard.

Steps to recreate

  1. Open MD file.
  2. Click on MD source code window.
  3. Verify that up/down/PgUp/PgDn keys scroll the window.
  4. Click on preview window.
  5. Observe that up/down/PgUp/PgDn keys have no effect.

Current behavior

The preview window can be scrolled with the mouse, but not the keyboard.

Expected behavior

Should be able to scroll the preview window with keyboard.

Implementing line auto completion on enter in tasks/list/blockquote

This is a question. I would like to implement auto completion when pressing the return key inside a tasks/list/blockquote/code indent...etc. It would basically go to next line and add the proper list/blockquote/tasks (supporting nested) automatically, with the correct indentation (and double return would break the pending blockquote/list). It is a bit like an auto-indent, but it is not only indentation but also characters used by the structure ( > or -...etc.)

But I'm a bit lost with the correct way to do it: Should it go through a IKeyProcessorProvider? or a ICompletionSource? Or through IIntellisenseController? a IOleCommandTarget? a IVsExpansionClient? another method?

Invalid indentation on the 2nd line of indented code blocks

It seems that when using indented code blocks, the first line is correctly handled, but subsequent lines have a small spaces inserted before. You can see it spotted as a red line on the screenshot:

original code:

    block
    line1
    line2
    line3

invalidindent

Feature request: fold by headings

It would be nice to be able to fold by headings(h1, h2, h3, etc.), just like Navigation Panel in Microsoft Word, this way we can edit long documents much easier.

Say, we have a document:

h1

h2

paragraph 1

code

h3

paragraph 2

h2

paragraph 3

we should be able to fold at h1 all content between this h1 and the next h1/eof;
we should be able to fold at h2 all content between this h2 and the next h2/h1/eof;
we should be able to fold at h3 all content between this h3 and the next h3/h2/h1/eof;

Curly braces in code blocks break down stream rendering

Installed product versions

  • Visual Studio: 2015 Professional
  • This extension: 1.1.25

Description

I have a code block like so in on of my documents http://{domain}/callbacks and after this renders none of the down stream headers do, but their content does.

Steps to recreate

  1. Use markdown from https://gist.github.com/xt0rted/a1b5d6383ada881ec9fb72e576758931

Current behavior

Headers after the code block aren't rendered.

markdowneditor

Expected behavior

Headers should be rendered.

Zoom factor too strong by default for the browser preview?

Installed product versions

  • Visual Studio: 2015 Professional
  • This extension: 1.0.12

Description

The zoom factor of the Markdown preview is too strong on my setup by default. Not sure why...

Currently I'm getting this:

markdowneditor

While I would expect something more like this (I dezoomed with the ctlr+mouse wheel):

markdowneditor2

Custom CSS for preview

Enhancement request

There should be a way to specify a custom CSS file for the preview. Ideally there would be a way to set a global default in the VS options, and a way to override that on per-project and per-file basis.

My use case is that the MD files I'm editing will ultimately become pages in a static web site. The formatting of some key elements (code blocks, definition lists, unordered lists, and tables) is quite different with my CSS compared to the default. I don't need the preview window to exactly match the final output, but I'd really like to get it closer.

Pulling the preview splitter left extends the preview over solution explorer

Installed product versions

  • Visual Studio: 2015 Enterprise 14.0.25123.00 Update 2
  • This extension: 1.1.33

Description

Pulling the preview splitter left extends the preview over solution explorer - i.e. outside the document window region

image

Steps to recreate

  1. Open a .md file
  2. Grab the splitter between raw and preview and drag left (if i'm careful I can get it to overlap partially - otherwise it extends to the edge of VS windows)

Current behavior

It overlaps my solution explorer

Expected behavior

It should stay within its document window region

Markdown node in Options dialog is not sorted alphabetically

Installed product versions

  • Visual Studio: 2015 Community
  • This extension: 1.2.52

Description

The Markdown node in the Options dialog doesn't appear in alphabetical order like the other languages do. It appears at the bottom instead. Here's what I mean:

image

Convert text to bulleted list

Description

Would like to have a function that would convert selected text to bulleted or numbered list, probably a quick action option, preferably with hotkey alternative.

Urls are being injected with emojis

Installed product versions

  • Visual Studio: 2015 Professional
  • This extension: 1.1.25

Description

Urls are being injected with emojis.

Steps to recreate

  1. Add a plain url to the document such as http://bing.com

Current behavior

The url is converted to http๐Ÿ˜•/bing.com

Expected behavior

:/ shouldn't be converted to an emoji

Visual Studio 2015 Crashes When Entering a Link

Installed product versions

  • Visual Studio: 2015 Update 3 (14.0.2542501)
  • This extension: 1.7.148

Description

When entering text for a link, Visual Studio becomes unresponsive and then crashes. The text to be shown instead of the link seems to require a space for the crash to occur.

Steps to recreate

  1. Open Visual Studio.
  2. Open a markdown file.
  3. Enter * [Release Note
  4. Visual Studio freezes and needs to be restarted.

Current behavior

Visual Studio shouldn't freeze and require a restart when entering text for a link.

Expected behavior

It should be allowing me to continue to enter the text with a space.

Notes

  • It has allowed me to open other documents with that text.
  • It doesn't mind if it is copied and pasted in.
  • It seems to be related to the capture.

"Compile Markdown to HTML" option missing

Installed product versions

Visual Studio

Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01038

Web Essentials

Web Essentials 2015.3 3.0.230

Mads' Markdown

Markdown Editor 1.6.133

Description

Various pages describing Web Essentials and Mads' Markdown extension describe a "Compile Markdown to HTML" menu option, however I do not see such an option in my installation.

Steps to recreate

  1. Open a C# project
  2. Create an *.md file
  3. The Markdown editor loads and works fine
  4. But in Solution Explorer, right-clicking the file shows no "Compile Markdown to HTML" menu item, all I see are disabled "Generate JavaScript Intellisense file" and "Generate TypeScript Intellisense file" options.
  5. There is no similar option in the Markdown Editor context menu nor the top-level Web Essential menu either.

Crash on empty link / while entering new link

Installed product versions

  • Visual Studio: Visual Studio Enterprise 2015, 14.0.25425.01 Update 3
  • This extension: 1.7.150

Description

When entering a new link, visual studio crashes.

Steps to recreate

  1. make new md file
  2. enter some text
  3. start creating a link by typing: [somelink
  4. now type the closing bracket: ]
  5. Visual studio will crash on step 4

Current behavior

Trying to enter a new link

Expected behavior

It should not crash

Triage

The error is due to the first line in MarkdownEditor.Parsing.MarkdownFactory.IsUrlValid().

if (url.Contains("://") || url.StartsWith("/") || url.StartsWith("#")) will crash if url is null

Stacktrace

>   MarkdownEditor.dll!MarkdownEditor.Parsing.MarkdownFactory.IsUrlValid(string file, string url) Line 77   C#
    MarkdownEditor.dll!MarkdownEditor.Parsing.MarkdownFactory.Validate(Markdig.Syntax.MarkdownDocument doc, string file) Line 51    C#
    System.Core.dll!System.Linq.Enumerable.Any<MarkdownEditor.Error>(System.Collections.Generic.IEnumerable<MarkdownEditor.Error> source)   Unknown
    MarkdownEditor.dll!MarkdownEditor.ErrorList.MarkdownParsed(object sender, MarkdownEditor.Parsing.ParsingEventArgs e) Line 54    C#
    [Native to Managed Transition]  
    [Managed to Native Transition]  
    MarkdownEditor.dll!MarkdownEditor.Parsing.MarkdownFactory.ParseToMarkdown.AnonymousMethod__0(Microsoft.VisualStudio.Text.ITextSnapshot key) Line 38 C#
    mscorlib.dll!System.Runtime.CompilerServices.ConditionalWeakTable<Microsoft.VisualStudio.Text.ITextSnapshot, Markdig.Syntax.MarkdownDocument>.GetValue(Microsoft.VisualStudio.Text.ITextSnapshot key, System.Runtime.CompilerServices.ConditionalWeakTable<Microsoft.VisualStudio.Text.ITextSnapshot, Markdig.Syntax.MarkdownDocument>.CreateValueCallback createValueCallback) Unknown
    MarkdownEditor.dll!MarkdownEditor.Parsing.MarkdownFactory.ParseToMarkdown(Microsoft.VisualStudio.Text.ITextSnapshot snapshot, string file) Line 33  C#
    MarkdownEditor.dll!MarkdownEditor.MarkdownClassifier.ParseDocument.AnonymousMethod__17_0() Line 143 C#
    mscorlib.dll!System.Threading.Tasks.Task.InnerInvoke()  Unknown
    mscorlib.dll!System.Threading.Tasks.Task.Execute()  Unknown
    mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot)    Unknown
    mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Unknown
    mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unknown
    mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()    Unknown
    mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unknown
    [Native to Managed Transition]  
    kernel32.dll!771f338a() Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]  
    ntdll.dll!77e29902()    Unknown
    ntdll.dll!77e298d5()    Unknown

Fix

Add the following code:

private static bool IsUrlValid(string file, string url)
{
    if (string.IsNullOrWhiteSpace(url))
        return false;

    if (url.Contains("://") || url.StartsWith("/") || url.StartsWith("#"))
        return true;

Sporadic "An exception has been encountered."

Installed product versions

  • Visual Studio: 2015 Professional (Update 2 & 3.. happened with both)
  • This extension: 1.4.102

Description

When opening a a solution which contains a markdown file that was open before closing VS, re-opening that solution again in VS (and therefore VS also automatically re-opening/displaying the .md file) I get an VS Error like this:

markdowneditor

---------------------------
Microsoft Visual Studio
---------------------------
An exception has been encountered. This may be caused by an extension.



You can get more information by examining the file 'C:\Users\joerg\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
---------------------------
OK   
---------------------------

.. and looking in the ActivityLog.xml, it reveals the following errors:

  <entry>
    <record>661</record>
    <time>2016/07/03 09:08:29.916</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.&#x000D;&#x000A;Parameter name: length&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Span..ctor(Int32 start, Int32 length)&#x000D;&#x000A;   at MarkdownEditor.MarkdownClassifier.GetClassificationSpans(SnapshotSpan span) in C:\projects\markdowneditor\src\Classifier\MarkdownClassifier.cs:line 64&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.&lt;GetTags&gt;d__5.MoveNext()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.&lt;GetTagsForBuffer&gt;d__38.MoveNext()</description>
  </entry>
  <entry>
    <record>662</record>
    <time>2016/07/03 09:08:29.916</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.&#x000D;&#x000A;Parameter name: length&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Span..ctor(Int32 start, Int32 length)&#x000D;&#x000A;   at MarkdownEditor.MarkdownClassifier.GetClassificationSpans(SnapshotSpan span) in C:\projects\markdowneditor\src\Classifier\MarkdownClassifier.cs:line 64&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.&lt;GetTags&gt;d__5.MoveNext()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.&lt;GetTagsForBuffer&gt;d__38.MoveNext()</description>
  </entry>
  <entry>
    <record>663</record>
    <time>2016/07/03 09:08:29.916</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.&#x000D;&#x000A;Parameter name: length&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Span..ctor(Int32 start, Int32 length)&#x000D;&#x000A;   at MarkdownEditor.MarkdownClassifier.GetClassificationSpans(SnapshotSpan span) in C:\projects\markdowneditor\src\Classifier\MarkdownClassifier.cs:line 64&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.&lt;GetTags&gt;d__5.MoveNext()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.&lt;GetTagsForBuffer&gt;d__38.MoveNext()</description>
  </entry>

Steps to recreate (assuming you have the Markdown Editor Extension installed)

  1. Clone my repository
  2. Open the serilog-sinks-applicationinsights.sln in VS and in it, open the 'assets\README.md' file (assets being a solution folder)
  3. Close VS and Restart it
  4. When VS restarts and re-opens the Readme.md file (and Markdown Editor seems to do its thing / initializing), the error above occurs

Current behavior

Uhm - An Error message box? "It all" (VS, markdown editing etc) does seem to work when clicking it away though.. that error message box just is a tad annoying

Expected behavior

No Error Messagebox!

Current line is deleted when pressing return at the start of it

Installed product versions

  • Visual Studio: 2015 Professional
  • This extension: 1.5.110

Description

The editor is deleting lines when pressing return at the start of the line.

Steps to recreate

Add the following text to a document

### Some Heading
- A list item

Then put your cursor at the start of the second line and press return.

Current behavior

The line you're on is deleted

Expected behavior

The line shouldn't be deleted and a new line should be added

Use asterisks for italics

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: 1.6.133

Description

When I type CTRL-I to italicize I get underscores surrounding the selection. For Markdown you can use either single asterisks or underscores. I prefer asterisks, in part because I use Markdown Editor for reStructuredText editing and rst doesn't understand underscores -- could we offer an option for asterisks, or make that the default?

word wrap doesn't work with Rmd

Installed product versions

  • Visual Studio: VS 2015 Community/Professional
  • Markdown Editor 1.7.154

Issue

I've been using your extension with rmarkdown files. The preview works automatically, and overall looks great. Unfortunately, word wrap doesn't work:
image

There's no value in Options -> Editors for Rmarkdown. Without the extension, Rmarkdown are automatically word-wrapped (using the RTVS extension)

Steps to recreate

  1. Open a Rmd file with long text chunks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.