Open AbhyudayaSharma opened 4 years ago
can you share an MD and what you expect it to look like?
@crutkas from one of my repositories:
Expected (as on GitHub):
Oh and the first line of the code block in the preview has extra margin to the left.
would this maybe be something you'd be interested in adding in?
It would be nice to have syntax highlighting for the preview of all different files, not just markdown. Like Rust, C++, Python, etc.
CC @Aaron-Junker
this is totally different rendering systems @jay-o-way. markdown previewers do fully rendered and GitHub chances are has more magic css than we do.
Here is common.md rendered vs https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/common.md
I personally don't see us taking the effort of integrating a system like GitHub has.
Yeah, next thing will be to add custom colors too. Can't we leverage something that exists? Like VS (Code) settings?
actually, if we can get Monaco to preview it, this could work. It is doing markdown to HTML and then does a webview2.
maybe it is possible ...
from https://stackoverflow.com/questions/51171733/how-to-get-markdown-preview-in-the-monaco-editor
import { renderMarkdown } from "monaco-editor/esm/vs/base/browser/markdownRenderer"
const htmlResult = renderMarkdown({
value: samplemarkdownData
}).innerHTML;
import { renderMarkdown } from "monaco-editor/esm/vs/base/browser/markdownRenderer"
const htmlResult = renderMarkdown({ value: samplemarkdownData }).innerHTML;
This does not work it processes code blocks in markdown just like the normal markdown previewer. .
Or did I understand you wrong.
Markdown preview does not do any syntax highlighting. Please enable syntax highlighting. This will prevent me from opening vscode for every README that I come across.