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 FontStyle.Strikethrough support #139413

Merged
merged 2 commits into from Dec 22, 2021
Merged

Add FontStyle.Strikethrough support #139413

merged 2 commits into from Dec 22, 2021

Conversation

ghost
Copy link

@ghost ghost commented Dec 17, 2021

This PR adds support for strikethrough fontStyle from Textmate spec and Sublime Text ecosystem.
Part of #43504 epic.

@ghost ghost marked this pull request as draft December 17, 2021 21:52
@ghost ghost mentioned this pull request Dec 18, 2021
@alexdima alexdima marked this pull request as ready for review December 22, 2021 10:32
@ghost ghost changed the title FontStyle.Strikethrough WIP Add FontStyle.Strikethrough support Dec 22, 2021
@ghost
Copy link
Author

ghost commented Dec 22, 2021

Does the markup.strikethrough Textmate token result in a strikethrough?

@alexdima
Copy link
Member

alexdima commented Dec 22, 2021

I have tested that everything is wired correctly using:

"editor.semanticTokenColorCustomizations": {
    "rules": {
        "enum": {
            "fontStyle": "strikethrough"
        }
    }
},
"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "markup.bold.markdown",
            "settings": {
                "foreground": "#FF0000",
                "fontStyle": "strikethrough"
            }
        }
    ]
},

I then tested it with a TypeScript file where there was an enum and with a markdown file where there was some bold text.

image
image


In order for ~~abc~~ to be rendered with a strike-through out-of-the-box in markdown, two more things need to happen:

  1. the markdown grammar needs to emit a special scope like e.g. markup.strikethrough when encountering ~~...~~.
  2. all builtin themes need to add a rule targeting markup.strikethrough and setting the fontStyle to strikethrough.

@sndst00m I suggest we merge this PR because it adds support for strikethrough, and then pursue 1. and 2. in a subsequent PR

cc @mjbvz @aeschli

@alexdima alexdima added this to the January 2022 milestone Dec 22, 2021
@alexdima alexdima merged commit 5c2b7b8 into microsoft:main Dec 22, 2021
@ghost
Copy link
Author

ghost commented Dec 22, 2021

I have already made the PR for strikethrough in the Markdown grammar🥳 microsoft/vscode-markdown-tm-grammar#100

@ghost ghost deleted the feat-fontstyle-strikethrough branch December 22, 2021 15:29
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2022
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.

1 participant