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

Multi-line OCaml comments not correctly highlighted #3044

Closed
dcorking opened this issue Aug 9, 2016 · 2 comments
Closed

Multi-line OCaml comments not correctly highlighted #3044

dcorking opened this issue Aug 9, 2016 · 2 comments

Comments

@dcorking
Copy link

dcorking commented Aug 9, 2016

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.

@Insti
Copy link

Insti commented Aug 9, 2016

Excellent bug report ❤️, thanks!

@k3rni
Copy link

k3rni commented Aug 11, 2016

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 span.c. This is valid HTML, but only accidentally. What happens when I change the "external" spans into divs?

<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.

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