Skip to content

Support markdown styling in task descriptions. #121338

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

Merged
merged 6 commits into from
Apr 15, 2021

Conversation

JacksonKearl
Copy link
Contributor

Closes #120050

@JacksonKearl JacksonKearl requested a review from mjbvz April 14, 2021 23:36
@JacksonKearl JacksonKearl self-assigned this Apr 14, 2021
@JacksonKearl JacksonKearl added this to the April 2021 milestone Apr 14, 2021
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.

Overall change looks good. Added a few notes.

Please make sure to add some tests too

@@ -235,7 +235,7 @@ ExtensionsRegistry.registerExtensionPoint({
},
description: {
type: 'string',
description: localize('walkthroughs.tasks.description', "Description of task. Use markdown-style links fo commands or external links: [Title](command:myext.command), [Title](command:toSide:myext.command), or [Title](https://aka.ms)")
description: localize('walkthroughs.tasks.description', "Description of task. Supports ``preformatted``, __italic__, and **bold** text. Use markdown-style links for commands for external links: [Title](command:myext.command), [Title](command:toSide:myext.command), or [Title](https://aka.ms). Links on their own line will be rendered as buttons.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would pre-formatted text use a single or double backtick? To match markdown, I think it should probably be a single one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't match markdown already, and this is more consistant with the existing... also it seems like markdown is happy with two backtick, even though one also works:

Markdown: one asterisk, two asterisk, one underscore, two underscore, one backtick, two backtick

Us: *one asterisk*, two asterisk, _one underscore_, two underscore, `one backtick`, two backtick

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok that's probably ok then and reduces the chance of accidentally creating a code block. I was confused because markdown does support ** and __ (but, as you noted, with different meanings than our formatter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I prefer our approach TBH, I always end up making weird italic markdown sections when trying to type out mathematic expressions in md-enabled inputs, for instance.

@@ -214,6 +219,8 @@ function formatTagType(char: string): FormatType {
return FormatType.Action;
case ']':
return FormatType.ActionClose;
case '`':
Copy link
Collaborator

Choose a reason for hiding this comment

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

When a backtick happens in a string that does not set supportPreformattedSegments, what happens? How does the parser handler FormatType.Invalid?

Copy link
Contributor Author

@JacksonKearl JacksonKearl Apr 15, 2021

Choose a reason for hiding this comment

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

Parser treats invalid tokens as normal chars and appends them to the text content of the node, they'd be invalid tokens before this change too.

@JacksonKearl JacksonKearl enabled auto-merge (squash) April 15, 2021 00:54
@JacksonKearl JacksonKearl merged commit 0a6309b into main Apr 15, 2021
@JacksonKearl JacksonKearl deleted the jackson/markdown-styling-task-descriptions branch April 15, 2021 00:57
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting Started: Consider supporting stripped down version of markdown in walkthrough descriptions
2 participants