mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[PR #78] [CLOSED] Syntax Highlighting for HTML, CSS, JS, XML, JSON and SVG #2400
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#2400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/78
Author: @AndrewBastin
Created: 8/28/2019
Status: ❌ Closed
Base:
master← Head:master📝 Commits (4)
f16e75aAdded prismjs dependency0a140f9Added syntax highlighting for html,xml,js,css,svg and json93bd9a4xhr status is outputed in a textarea when an error occurs in the request90095e6updated copy response to use the new syntax highlighting📊 Changes
4 files changed (+109 additions, -4 deletions)
View changed files
📝
assets/css/styles.scss(+15 -2)📝
package-lock.json(+46 -0)📝
package.json(+1 -0)📝
pages/index.vue(+47 -2)📄 Description
Sorry for the delays, I am kinda busy with travelling these days...
So yeah, this PR adds syntax highlighting to the responses powered by Prism.
It looks at the returned content-type and applies the equivalent highlighting...
Well, I had to change a bit in the way how the responses are rendered, it relies on a property (responseHtml) now to render the raw html into the response box. Also, since textarea doesn't allow formatting, when an unsupported MIME type is returned, it defaults to the old textarea based layout but when a supported mime is returned, instead the content is rendered within a code tag inside a pre tag (ie,
<pre><code>{{ content }}</code></pre>).There are some stuff we will lose like the stretching textarea and stuff, and if there are no line breaks, the content box keeps expanding even out of the viewport. Someone should like update this PR with the ability to have proper overflow handling (I kinda don't want to work with the CSS on that one).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.