-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Presing Tab key after a word in markdown file creates XML tags #16569
Comments
Tab
key after a word in markdown file creates XML tags
Tab
key after a word in markdown file creates XML tags
This is coming from Emmet. To disable this, add: "emmet.excludeLanguages": ["markdown"], to your settings. Although this is currently the expected behavior, I think we should probably disable emmet expansions in markdown by default because this behavior can be annoying during normal writing. @ramya-rao-a Any thoughts? |
@ramya-rao-a this behaviour is a consequence of #9500, which has as the goal to not hard code in which language modes emmet is enabled for. As a heuristic #9500 uses the grammar's scope name hierarchy as a hint. This heuristic has worked pretty well. The scope of the markdown grammar is According the emmet doc there is no special syntax profile available for Markdown #9500 (comment). So a quick fix would be to:
@mrmlnc do you have other ideas how to improve the support for emmet in Markdown and avoid the surprise described in this issue? |
Hello, @egamma, I see the same way as you suggested above. But, perhaps, we can also disable Markdown in the settings, as it was for If you decide to disable Emmet inside Markdown, it is better to first option. But my 2 cents: Markdown is a lightweight markup language and it presupposes the existence of HTML constructs within yourself. Thus, it seems to me, to disable Emmet inside Markdown is not correct. P.S. Small news: the creator of Emmet had already started work on the second version aka 2.0.0 🐼 |
@mrmlnc thanks for the feedback. I agree with your point that disabling emmet without some way to re-enable it, if someone really wants emmet is better than to totally disable it. Glad to hear about Emmet 2.0. |
@egamma Could |
@mjbvz the idea is good. It has a small drawback. If someone defines However, if someone if familiar with this setting and then they know how to disable emmet in markdown, if they are annoyed by it. Bottom line I'm fine with this fix. |
Ok, I've merged in #17094 which adds |
Steps to Reproduce:
Create a
test.md
fileAdd a sentence of text such as
Put your keyboard cursor after
Lorem
Press Tab
Expected: Spaces or tabs to be added between
Lorem
andipsum
Result:
Lorem
word gets converted into an XML tag and auto closed, leaving us withIn Action
The text was updated successfully, but these errors were encountered: