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

Comment inside enumeration doesn't work #8

Open
ullenboom opened this issue Jul 23, 2013 · 2 comments
Open

Comment inside enumeration doesn't work #8

ullenboom opened this issue Jul 23, 2013 · 2 comments

Comments

@ullenboom
Copy link

  * [[:Start]]
/* * Community */

->

  • Start

Community */

so the line plus */ stays. I can fix this by inserting an empty line although its just a fix for a parser imperfection.

  * [[:Start]]

/* * Community */
@DomoViridi
Copy link

The current regular expression used to find the comments is broken. It reads:

"^/\*.*?\*|\s+/\*.*?\*/"

This matches either:

  • At the beginning of a line (^) start at /*, match the shortest string of any characters (.*?) followed by a star (*)
  • Or (|)
  • At least one whitespace (which may include newlines) (\s+) followed by /*, followed by the shortest string of any characters (.*?), followed by */.

Notice that the first case ends the match in *, not in */. This is what happens in your example, where the match ends with the lone * and the Community */ part is left over.
When you add an empty line before the comment string, the second case comes into action which (more correctly) matches <whitespace> '/*' <any characters> '*/'

In commit 5298672 editor Michael Klier simply describes his change as "fixed regex" and does not explain why he exchanged a simple regex, which by the way also includes a match with comments of the style

// One-line comment

with a more complicated one which only allows a comment which either starts at the beginning of a line or is preceded by whitespace. And which is broken 😦

@lpaulsen93
Copy link
Member

This could also be fixed by the change suggested in #12. Please test.

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

No branches or pull requests

3 participants