Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

multiple problems with multiline JS comments #26

Open
masukomi opened this issue Dec 10, 2019 · 1 comment
Open

multiple problems with multiline JS comments #26

masukomi opened this issue Dec 10, 2019 · 1 comment

Comments

@masukomi
Copy link

masukomi commented Dec 10, 2019

using this JS file

// TODO: a thing
// todo lower case thing
/* foo
TODO: in multiline comment
	TODO tab indented in multiline comment
  TODO: space indented in multiline comment
*/

the output for the multiline section is

TODO: foo
 in multiline comment
	 tab indented in multiline comment
   space indented in multiline comment

problems:
a) "foo" has nothing to do with the todo
b) leading whitespace shouldn't be displayed
c) none of the TODO items are actually highlighted as TODOs like normal output. instead they're under "foo" which isn't even a todo thing.

@patrickdevivo
Copy link
Contributor

Hi @masukomi thanks for bringing up, and apologies for not responding sooner! The behavior you're describing is "expected," but certainly flawed. There's a couple of odd things I'd like to fix up.

  • The entire comment a TODO string is in gets saved as the TODO, hence foo is included in the output, since the entire block comment is saved
  • The TODO string is stripped out of the comment, sometimes making for odd output, especially when the TODO is in the middle of a line or phrase. This displays ok for when TODO starts the comment or line, but as you point out, is bizarre when there's an indent or it appears somewhere else in the comment

I'd like to experiment a bit, but I think with some more sensible parsing within the comment we should be able to clean this up a bit!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants