Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Markdown Syntax Highlighting since 1.3.0 #9075

Closed
gerane opened this issue Jul 11, 2016 · 8 comments
Closed

Broken Markdown Syntax Highlighting since 1.3.0 #9075

gerane opened this issue Jul 11, 2016 · 8 comments
Assignees
Labels
markdown Markdown support issues

Comments

@gerane
Copy link

gerane commented Jul 11, 2016

EDIT: most of these issues appear to be from 1.3.0. If I try the same files in an earlier version of code, they look closer to those in the atom examples. I added a pre 1.3.0 VSCode image to example 2. None of the other issues such as bold, italics, html, code blocks, or anything else have issues in earlier versions. These all seem to have been introduced recently when making markdown its own language I am guessing.

I use markdown for writing documentation and blog posts, and this is the one thing keeping me from 100% moving to VSCode. The syntax is so poor that I have to continue using atom for things like blog posts, which is ironic since half my posts these days are about VSCode. I am adding a few pictures to show how bad VSCode is in comparison to Atom and point out some of the areas that need improvement.

Example 1

VSCode
vscodemarkdown
Atom
atommarkdown

Example 2

VSCode Pre 1.3.0
image
VSCode
vscodemarkdown2
Atom
atommarkdown2

You get the same poor results in pretty much every theme.

A few of the issues that stand out:

  • adding bold or italics to a list breaks the coloring.
    bolditalics
  • Lists should appear like Atom with only the bullet being colored as seen in example 2 above.
  • Lists for sections like Jekyll blogs should properly highlight similar to Atom.
    atomlistjekyll
    listjekyll
  • Having multiple bold or italics words in the same line breaks the rest of the document.
    vscodehtml
    atomhtml
  • Small amounts of html like it can't handle if in a list
    vscodehtmllist
  • Lists break any syntax coloring in the line.
    atomsyntaxlist
    vscodesyntaxlist

There are likely some other issues, but they are escaping me right now. I will try to update this if I can remember any others.

  • VSCode Version: 1.4.0-insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Compare 2 theme between Atom and VSCode
@gerane
Copy link
Author

gerane commented Jul 11, 2016

These seem more like issues in the language\tmlanguage and not simple theme\tmtheme issues. Every single theme has these issues that I have tried. While Dark and Dark+ may have fixed the bullet part, all of the other issues are still present.

@gerane
Copy link
Author

gerane commented Jul 11, 2016

I edited the original post, I hadn't used code for markdown in a while and was attempting to finally switch. It appears the syntax for markdown used to be pretty decent, but some recent changes have made it terribly broken. To the point it is unusable for me. I checked an older version of code and the syntax works just fine. None of the issues highlighted here were issues in the earlier version.

@MovGP0
Copy link

MovGP0 commented Jul 11, 2016

Here is a nice example with a table and escaped regex that is broken:

proper highlighting in Github

### regular expressions

<table>
<tbody>
<tr><td>`^`</td><td>Begin</td></tr>
<tr><td>`$`</td><td>End</td></tr>
<tr><td>`.`</td><td>any character</td></tr>
<tr><td>`[A-Z]`</td><td>range</td></tr>
<tr><td>`\d`</td><td>digit</td></tr>
<tr><td>`?`</td><td>0 or 1</td></tr>
<tr><td>`+`</td><td>1 or more</td></tr>
<tr><td>`*`</td><td>0 or more</td></tr>
<tr><td>`[^a]`</td><td>except a</td></tr>
<tr><td>`\\`</td><td>escape sequence</td></tr>
<tr><td>`\w`</td><td>whitespace</td></tr>
<tr><td>`\s`</td><td>space</td></tr>
</tbody>
</table>

markdown table syntax (not working)

| `^` | Begin
| `$` | End
| `.` | any character
| `[A-Z]` | range
| `\d` | digit
| `?` | 0 or 1
| `+` | 1 or more
| `*` | 0 or more
| `[^a]` | except a
| `\\` | escape sequence
| `\w` | whitespace
| `\s` | space

broken highlighting in Code

regex in table

broken rendering in Code

regex in table preview

@MovGP0
Copy link

MovGP0 commented Jul 11, 2016

seems like the Markdown plugin uses markdown-it for markdown rendering and highlight.js for syntax highlighting of code blocks. it delegates the view of markdown sourcecode to the text editor of code. so its probably not an issue of the extension.

@gerane gerane changed the title Poor Markdown Syntax Highlighting Broken Markdown Syntax Highlighting since 1.3.0 Jul 11, 2016
@gerane
Copy link
Author

gerane commented Jul 13, 2016

ref #8214

@gerane
Copy link
Author

gerane commented Sep 19, 2016

Any updates on this?

@mjbvz mjbvz added the markdown Markdown support issues label Oct 4, 2016
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 11, 2016

@MovGP0 The syntax highlighting of your examples seems to have been fixed:

screen shot 2016-11-11 at 2 33 59 pm

The renderer uses commonmark, which does not yet support tables in markdown, so the second example is not rendered as a table. The incorrect rendering of the second example is therefore expected, but most users are probably used to github flavored markdown.

Please give the latest insiders builds a try and open bugs for any issue you notice. Thanks.

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 11, 2016

@gerane Can you please try out the latest insiders builds to see what has been fixed. We've made a number of fixes to the markdown grammar, and these may resolve many of problems you were seeing.

I'm going to close this issue, but if you are still seeing any syntax highlighting problems, please open new issues for these (smaller issues are generally better). Please include the markdown source to help with investigation and testing. Thanks

@mjbvz mjbvz closed this as completed Nov 11, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests

4 participants