Closed earthboundkid closed 6 years ago
Should have as many classes as manni style does.
Actually, the output from the 'manni' style is also not complete. I see that chroma also generates a .p
and .nt
class for the HTML syntax highlight, and those are not in 'manni' (also not in the ''vs' style).
Worse thing is that the 'vs' style does include an empty class (2nd line):
/* Background */ .chroma { background-color: #ffffff }
/* Error */ .chroma .err { }
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { color: #0000ff }
/* KeywordConstant */ .chroma .kc { color: #0000ff }
/* KeywordDeclaration */ .chroma .kd { color: #0000ff }
/* KeywordNamespace */ .chroma .kn { color: #0000ff }
/* KeywordPseudo */ .chroma .kp { color: #0000ff }
/* KeywordReserved */ .chroma .kr { color: #0000ff }
/* KeywordType */ .chroma .kt { color: #2b91af }
/* NameClass */ .chroma .nc { color: #2b91af }
/* LiteralString */ .chroma .s { color: #a31515 }
/* LiteralStringAffix */ .chroma .sa { color: #a31515 }
/* LiteralStringBacktick */ .chroma .sb { color: #a31515 }
/* LiteralStringChar */ .chroma .sc { color: #a31515 }
/* LiteralStringDelimiter */ .chroma .dl { color: #a31515 }
/* LiteralStringDoc */ .chroma .sd { color: #a31515 }
/* LiteralStringDouble */ .chroma .s2 { color: #a31515 }
/* LiteralStringEscape */ .chroma .se { color: #a31515 }
/* LiteralStringHeredoc */ .chroma .sh { color: #a31515 }
/* LiteralStringInterpol */ .chroma .si { color: #a31515 }
/* LiteralStringOther */ .chroma .sx { color: #a31515 }
/* LiteralStringRegex */ .chroma .sr { color: #a31515 }
/* LiteralStringSingle */ .chroma .s1 { color: #a31515 }
/* LiteralStringSymbol */ .chroma .ss { color: #a31515 }
/* OperatorWord */ .chroma .ow { color: #0000ff }
/* Comment */ .chroma .c { color: #008000 }
/* CommentHashbang */ .chroma .ch { color: #008000 }
/* CommentMultiline */ .chroma .cm { color: #008000 }
/* CommentSingle */ .chroma .c1 { color: #008000 }
/* CommentSpecial */ .chroma .cs { color: #008000 }
/* CommentPreproc */ .chroma .cp { color: #0000ff }
/* CommentPreprocFile */ .chroma .cpf { color: #0000ff }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericHeading */ .chroma .gh { font-weight: bold }
/* GenericPrompt */ .chroma .gp { font-weight: bold }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { font-weight: bold }
This is problematic because an empty class suggests that all Chroma classes are there and that the CSS file is complete. But it's actually not.
Edit: After a bit more testing I learned that the following classes are missing from hugo gen chromastyles
:
.chroma .p
: used in HTML syntax, not in 'vs' style..chroma .nt
: used in HTML syntax, not in 'vs' style..chroma .mh
: used with CSS syntax, not in 'vs' style..chroma .na
: used with HTML (and C#) syntax, not in 'vs' style..chroma .o
: used with HTML syntax, not in 'vs' style..chroma .nn
: used with C# syntax, not in 'vs' style..chroma .n
: used with C# syntax, not in 'vs' style.it's a bit worse than that, I think:
specifically, Hugo is generating bad css, that fails linting and breaks in safari 11.0.2 (latest 10.13.2 beta):
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
the ;
as the first rule causes none of the styles for code to be rendered.
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
I think this was improved by https://github.com/alecthomas/chroma/commit/c9f612c1940a4951cd2b55811744632a7b3b3bb2 but I'm not totally sure how to test it.
@carlmjohnson The issue concerning broken css output has been already fixed upstream and is included in current hugo release.
How to verify:
hugo gen chromastyles --style=github
Output (redacted) — this is good output:
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
Wrong output was:
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
Any issues with missing/incomplete css classes on some highlighting styles have to be resolved upstream.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Some styles appear to have too few classes.
Actual output:
Expected output:
Should have as many classes as manni style does.