-
Notifications
You must be signed in to change notification settings - Fork 9.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
ReSpec build script: no automatic syntax highlighting for unspecified or "unknown" languages #4107
ReSpec build script: no automatic syntax highlighting for unspecified or "unknown" languages #4107
Conversation
Jay, I had a test for this 😄
Can we update highlight.js to get more languages? I really wish urlencoded highlighting were supported (I believe it's possible). (I'm not blocking on this, just don't have time to properly review this morning and wanted to ask before I forgot) |
We are already using the latest version of highlight.js, and we can either try to find a supported language that looks nice for URL templates and query parts, or register a custom language for it: Both approaches would require to differentiate between |
At least some packages have plugins for urlencoded. Not sure I’ve seen uritemplates but yes def different format! |
@handrews Copied some snippets I found on StackOverflow and it now looks better than all-black or all-red. If you have a better copy template, please tell me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ralfhandl this is fantastic! I verified it in a local build.
We intentionally format code blocks with
highlight.js
if the explicitly specified language of the code block is known to this package.Formerly we left highlighting of unknown languages or code blocks with unspecified language to ReSpec, which now leads to erratic results, see #4103.
This PR suppresses automatic syntax highlighting by ReSpec for code blocks whose language is not specified or unknown to
highlight.js
.It also adds two custom languages
uri
anduritemplate
that are used inPreview: