question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Inline comment ending a line prevents ignoring of multiline comment later in file

See original GitHub issue

Describe the Bug

This is related to #223 and #269 and is a minimal repro of the issue I was commenting on at the bottom of #223. Multiline comments are not successfully ignored if an inline comment earlier in the file ends a line. Putting a space between inline comment and linebreak does not fix this, putting text between does.

How to Reproduce

Set “paragraph blank lines” rule on OR set “two spaces between lines with content” on. (Not both.)

%% fold %%

## R

%%
HW:: --
T:: 0
%%

Expected Behavior

Linter output for the bottom of the file (starting ## R) should be the same as if the input was:

%% fold %% notComment

## R

%%
HW:: --
T:: 0
%%

Device

  • Desktop

Note: The file initially had a second multiline block comment above the inline comment which was successfully ignored by both “paragraph blank lines” and “two spaces between lines with content” rules.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
pjkaufmancommented, Jul 18, 2022

I have a fix in place for the above, but I am guessing I should see about being a little more thorough on ignoring obsidian multiline comments. At this time, obsidian single line comments are not ignore by the linter.

I am guessing the following scenarios would need modification to make sure they do not cause issues:

  • obsidian multiline comment in the middle of a paragraph (likely gets 2 spaces tacked on at the end if not the last line in paragraph or gets a blank line before and after it)
  • Obsidian multiline at the end of a paragraph will cause the previous line to get 2 spaces on despite it being followed by a comment
  • Obsidian multiline at the start of a paragraph with more than 1 line will likely get 2 spaces at the end of it and a blank line before and after it despite not counting as paragraph content

Do you think these need fixing @AnnaKornfeldSimpson ?

Thanks for all of the feedback and help pointing out issues.

1reaction
pjkaufmancommented, Jul 25, 2022

This issue should be resolved on master. Please let us know if this is not resolved on master or in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to put a line comment for a multi-line command [duplicate]
The best you can do is a comment on the lines before the command, or one single comment at the end of the...
Read more >
Can I comment a block of lines in an MATLAB file using ...
You can comment out a block of code in MATLAB using the block comment operators, %{ and %}. The %{ and %} operators...
Read more >
How To Write Comments in Go - DigitalOcean
Inline comments occur on the same line of a statement, following the code itself. Like other comments, they begin with a set of...
Read more >
Comments in programming languages
An end-of-line comment terminates at the end of the line. A block line comment has a terminator and can continue for several lines,...
Read more >
JavaScript Comments - W3Schools
Any text between /* and */ will be ignored by JavaScript. This example uses a multi-line comment (a comment block) to explain the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found