Skip to content

Notebook Mode: The comment block is not recognized as a Markdown block #2845

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

Closed
mkht opened this issue Jul 31, 2020 · 8 comments · Fixed by #2848
Closed

Notebook Mode: The comment block is not recognized as a Markdown block #2845

mkht opened this issue Jul 31, 2020 · 8 comments · Fixed by #2848
Labels
Issue-Bug A bug to squash.

Comments

@mkht
Copy link

mkht commented Jul 31, 2020

Well, can I post any feedback on the Notebook mode that Tyler Leonhardt has posted on the PowerShell blog?
https://devblogs.microsoft.com/powershell/public-preview-of-notebook-mode-in-the-powershell-preview-extension-for-visual-studio-code/

Issue Description

The comment block style that our team normally uses doesn't seem to be correctly parsed as a Markdown block in the Nodebook mode.

<# =========================
# Write comment here
============================ #>

I hope this is improved.

Text mode

image

Notebook mode

image

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jul 31, 2020
@TylerLeonhardt
Copy link
Member

That's odd. That should work. Do normal block comments work?

<#
Foo
#>

@mkht
Copy link
Author

mkht commented Jul 31, 2020

Hi @TylerLeonhardt
Yes, normal block comments are working fine.

note

@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2020

What about this one:

<# x
 # Comment
#>

or this one:

<#
 # Comment
x #>

Or

<#
 # Comment
    #>

(Spacing before the end delimiter)

@TylerLeonhardt
Copy link
Member

I bet the first case is broken

@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2020

The code indicates that we expect the whole line to be the comment delimiter, rather than just contain it:

} else if (lines[i] === "<#") {

if (lines[i] === "#>") {

@mkht
Copy link
Author

mkht commented Jul 31, 2020

Unfortunately, this is not good in all three cases.
Is this an issue specific to my environment? Is everyone OK?

Case 1

case1

Case 2

case2

Case 3

case3

@rjmholt
Copy link
Contributor

rjmholt commented Jul 31, 2020

Is this an issue specific to my environment?

It's a general bug that we'll fix in the next update. For now cells must start with the line <# and end with the line #>

@TylerLeonhardt
Copy link
Member

Yep, should be a straightforward fix and you've given us a great test case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants