idea-markdown
idea-markdown copied to clipboard
Preview tab unavailable in scratch files
In rubymine 7.1.1, preview works as intended in .md files in the project filetree, but when I open a markdown scratch file it fails to show a preview tab.
- Tools> New Scratch File
- 'Markdown'
- No preview :(
I am having this problem too.
The issue is with the file type returned by scratch files. Regular files will have the markdown file type. Scratch files do not. To get the file type of the scratch file you need to request this information from the scratch file service. So idea-markdown does not recognize scratch files as markdown.
You can see the code I use in idea-multimarkdown plugin, which is an overhauled and enhanced version of idea-markdown. The code to handle this can be seen here: https://github.com/vsch/idea-multimarkdown/blob/master/src/main/java/com/vladsch/idea/multimarkdown/editor/MultiMarkdownPreviewEditorProvider.java#L58-L61
Notice: This plugin is no more maintained and it has been removed from Jetbrains plugins repository. There is a Markdown plugin officially supported by Jetbrains.