-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Multi-line OCaml comments not correctly highlighted #3044
Comments
Excellent bug report ❤️, thanks! |
The problem is in lib/rouge/formatters/html_exercism.rb:66, where the HTML-wrapped string is cut into lines with no regard for its structure. Each line is then wrapped into a span. It's easily seen in the raw HTML output (not your browser's inspector), tags rearranged for clarity: <span id='L4'></span>
<span id='L5'><span class="c">(* reverse the first list, then prepend it to the second list. (In</span>
<span id='L6'> other words, one by one, move the head of the first list onto the head</span>
<span id='L7'> of the second.) *)</span></span> What should happen here is that each of the comment lines should be wrapped in its own <div id='L4'></div>
<div id='L5'><span class="c">(* reverse the first list, then prepend it to the second list. (In</div>
<div id='L6'> other words, one by one, move the head of the first list onto the head</div>
<div id='L7'> of the second.) *)</span></div> which is clearly invalid. |
Multiline comments, such as those in my submission are not correctly highlighted for syntax.
The second and subsequent lines are formatted as code, not as comments.
The same code pasted onto the Rouge demo site seems to format better.
The text was updated successfully, but these errors were encountered: