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

Chroma injects unexpected line breaks in function names when parsing C++ #124

Closed
manvis opened this issue Mar 1, 2018 · 4 comments
Closed

Comments

@manvis
Copy link

manvis commented Mar 1, 2018

I've used Chroma both from within Hugo and command line. Try this simple code:

int main() {
    return 0;
}

When the language is set to C, Chroma creates correct HTML. When the language is set to C++, I start seeing unexpected line breaks.

bugreport

@alecthomas
Copy link
Owner

I think that might be caused by d7ee3c1. Can you try the commit before that one and see if that fixes it? If so, I'll revert it for now.

@manvis
Copy link
Author

manvis commented Mar 2, 2018

I've tried to reset to before the commit you indicated. Unfortunately, the problem seems to be elsewhere. The problem occurs even if I output html without line numbers or if I use the terminal formatter. Moreover, it seems that only C++ function names are affected.

It is possible I'm mixing something up because I'm not too familiar with golang (and especially building applications). However, considering that display: block; got removed from the LineNumbersTable style in the exported css, I assume I did things correctly.

@alecthomas
Copy link
Owner

Thanks for the report! I dug into it and it turned out to be quite a bit more involved than I first suspected. Anyhow, it should be fixed now.

@manvis
Copy link
Author

manvis commented Mar 3, 2018

Thank you for the quick fix.

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

2 participants