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

Add source map for every possible element in the Markdown preview #134799

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

Lemmingh
Copy link
Contributor

This PR fixes #133376

Summary

We have to clean up type definitions before the main work.

  • Update markdown-it and type definitions

    • Update markdown-it and its DT so that they match now.
    • Update dompurify and its DT so that they match now.
    • Remove @types/highlight.js because highlight.js has its own type definitions since version 10.
    • Fix mismatches related to markdown-it. Note that lots of any are removed to allow TypeScript to infer type.
  • Refresh the source map mechanism in markdownEngine.ts

Note on attrSet() and attrGet()

markdown-it's Token is designed in a bad smell with no access control.

Given Renderer.renderAttrs() and the HTML Standard, an attribute set via Token.attrSet() should still work even in extreme cases.

The use of Token.attrGet() is for a similar reason.

Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The new logic seem good and thanks for the additional cleanup!

@mjbvz mjbvz merged commit d3ceb35 into microsoft:main Oct 12, 2021
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 12, 2021

Will be in the next insiders build and schedule to ship in stable as part of VS Code 1.62

@mjbvz mjbvz added this to the October 2021 milestone Oct 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add source map for every block-level element in the Markdown preview
2 participants