question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Syntax Highlighting

See original GitHub issue

Swagger 2 had a nice syntax highlighting for json/xml samples.

I might be missing something, but I don’t see it in the “Known Issues” section of the README.md, is this planned or is there a way to enable it on swagger-ui 3?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:17
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
biggatescommented, Jun 23, 2017

swagger-ui currently uses microlight and has a component named HighlightCode . I tried to modify it with highlight.js and am going through several problems currently:

  • highlight.js requires type of language, which is not known yet in this component
  • some styles are marked important and have to be
  • need to find a way to “alter” component and styles as a plugin
  • and a method to avoid dangerouslySetInnerHTML (maybe in a react way using react-lowlight )

visual effect:

image

4reactions
shockeycommented, Jun 7, 2017

npm has some nice react components that handle syntax highlighting: https://www.npmjs.com/search?q=react+syntax+highlighting

a community PR that adds this functionality would be wonderful, and not difficult to implement!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax highlighting - Feature Requests - Notejoy
Automatically highlight syntax appropriately (across a variety of languages) when code in embedded in a Notejoy note. This is now available!
Read more >
Feature Request: Add syntax highlighting · Issue #127 - GitHub
I'd be open to installing a separate plugin for XMP with code highlighting if that's what it takes. I could partially sponsor an...
Read more >
Feature Request: Syntax highlighting in the editor
Please add the ability to add a code block via the rich text editor that offers syntax highlighting. See example image below.
Read more >
Support diff syntax highlighting in Markdown code blocks ...
Feature Request - Support diff syntax highlighting in Markdown code blocks. Release notes. Support diff syntax highlighting in GLFM code block.
Read more >
Feature request: Add syntax highlighting for Markdown
I'm wondering about this: amongst the many languages which have syntax highlighting on is missing: Markdown. :-) Any reason why this isn't implemented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found