Skip to content

Fix multiline comments highlighting in c++ #22

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

Closed

Conversation

rafalk342
Copy link

@rafalk342 rafalk342 commented Nov 28, 2017

I've corrected handling multiline comments in c++.
Every tag with a multiline comment is changed into a multiple tags with only one line.

@wcoder
Copy link
Owner

wcoder commented Nov 28, 2017

@rafalk342 Thanks for your help! #21
I will check your solution for other languages.

var children = element.childNodes;
for(var child in children){
if(children.hasOwnProperty(child)) {
if(children[child].className === "hljs-comment"){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing against "hljs-string" also fixes the highlighting of multi-line strings

@anlambert
Copy link
Contributor

For your information, there is a similar issue regarding the highlighting of multi-line strings (for instance, Python ones). See comment in the PR diff for the fix.

swhmirror pushed a commit to SoftwareHeritage/swh-web that referenced this pull request Jan 23, 2018
@wcoder
Copy link
Owner

wcoder commented Feb 17, 2018

Hi everyone

I investigated this issue #21 and made a common solution.

Please, try it on the separate branch:

https://github.com/wcoder/highlightjs-line-numbers.js/blob/bugfixes/multiline-nodes/src/highlightjs-line-numbers.js

@anlambert
Copy link
Contributor

Hi @wcoder,

I confirm this fixes the encountered issues.

Cheers!

@rafalk342
Copy link
Author

Hello @wcoder,
I also confirm that this fixes the issue.
Thanks for moving with it forward.

wcoder added a commit that referenced this pull request Feb 22, 2018
@wcoder
Copy link
Owner

wcoder commented Feb 22, 2018

Thank you for feedbacks and check.

Released new version 2.2 with this fix.

@wcoder wcoder closed this Feb 22, 2018
swhmirror pushed a commit to SoftwareHeritage/swh-web that referenced this pull request Feb 23, 2018
This new release fixes multi-line strings and comments highlighting bugs
(see wcoder/highlightjs-line-numbers.js#22 and
wcoder/highlightjs-line-numbers.js#30).
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

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy