[PR #5597] [MERGED] fix: ensure correct parser for xml and plaintext #5271

Closed
opened 2026-03-17 02:44:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5597
Author: @jaeyonglee-int
Created: 11/19/2025
Status: Merged
Merged: 12/2/2025
Merged by: @jamesgeorge007

Base: patchHead: ensure-correct-parser-for-xml-and-plaintext


📝 Commits (6)

  • 13f233b remove yaml parser for plaintext, add xml parser for text xml
  • db98129 update editorutils test
  • c186e7c remove unnecessary import
  • e35e494 map text plain to text plain instead
  • 9b6affa update unit tests
  • 2f1bf93 fix: add prettification support for text/xml content type

📊 Changes

4 files changed (+20 additions, -11 deletions)

View changed files

📝 packages/hoppscotch-common/src/components.d.ts (+4 -1)
📝 packages/hoppscotch-common/src/components/http/RawBody.vue (+5 -1)
📝 packages/hoppscotch-common/src/helpers/__tests__/editorutils.spec.js (+8 -7)
📝 packages/hoppscotch-common/src/helpers/editorutils.ts (+3 -2)

📄 Description

Closes #5294, FE-981.

This change does 3 things:

  • Maps "text/plain" as the parser for text/plain. codemirror.ts would eventually set the language to null anyway since its getLanguage function does not have a plaintext language and would return null (as expected). We still map plaintext to "text/plain" for better readability
  • Maps application/xml as the parser for text/xml
  • Changes the default fallback parser to "text/plain" rather than yaml. Again, inside codemirror.ts, the language would still be set to null and no language specific parsing/highlighting would happen. We choose to return text/plain knowing this.

Summary by cubic

Fixes parser selection for text/plain and XML and adds prettify support for text/xml. Also prevents clearing responses in examples/test runner and cleans up published docs that reference deleted collections.

  • Bug Fixes
    • Map text/plain to text/plain; map text/xml to application/xml; fallback to text/plain.
    • Show and apply XML prettify for text/xml.
    • Disable/hide “Clear response” in response examples and the test runner.
    • Remove orphaned published docs with missing collections and make creator nullable with session fields serialized.

Written for commit 2f1bf936ed. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5597 **Author:** [@jaeyonglee-int](https://github.com/jaeyonglee-int) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 12/2/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `ensure-correct-parser-for-xml-and-plaintext` --- ### 📝 Commits (6) - [`13f233b`](https://github.com/hoppscotch/hoppscotch/commit/13f233b2f8d3661bd3e1cf229477c942abe6484f) remove yaml parser for plaintext, add xml parser for text xml - [`db98129`](https://github.com/hoppscotch/hoppscotch/commit/db981296951a52da84886bc4114e52d364838eb0) update editorutils test - [`c186e7c`](https://github.com/hoppscotch/hoppscotch/commit/c186e7c221be7ba3a6274e02eecd958da96189ad) remove unnecessary import - [`e35e494`](https://github.com/hoppscotch/hoppscotch/commit/e35e4944934ccfca6340f2f431f60b568e594c59) map text plain to text plain instead - [`9b6affa`](https://github.com/hoppscotch/hoppscotch/commit/9b6affa20bd67d034460f00c84907018ee96a426) update unit tests - [`2f1bf93`](https://github.com/hoppscotch/hoppscotch/commit/2f1bf936ed57aaedad8b4b4cca72a860d337351b) fix: add prettification support for text/xml content type ### 📊 Changes **4 files changed** (+20 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components.d.ts` (+4 -1) 📝 `packages/hoppscotch-common/src/components/http/RawBody.vue` (+5 -1) 📝 `packages/hoppscotch-common/src/helpers/__tests__/editorutils.spec.js` (+8 -7) 📝 `packages/hoppscotch-common/src/helpers/editorutils.ts` (+3 -2) </details> ### 📄 Description Closes #5294, FE-981. This change does 3 things: - Maps "text/plain" as the parser for text/plain. `codemirror.ts` would eventually set the language to null anyway since its getLanguage function does not have a plaintext language and would return null (as expected). We still map plaintext to "text/plain" for better readability - Maps application/xml as the parser for text/xml - Changes the default fallback parser to "text/plain" rather than yaml. Again, inside `codemirror.ts`, the language would still be set to null and no language specific parsing/highlighting would happen. We choose to return text/plain knowing this. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes parser selection for text/plain and XML and adds prettify support for text/xml. Also prevents clearing responses in examples/test runner and cleans up published docs that reference deleted collections. - **Bug Fixes** - Map text/plain to text/plain; map text/xml to application/xml; fallback to text/plain. - Show and apply XML prettify for text/xml. - Disable/hide “Clear response” in response examples and the test runner. - Remove orphaned published docs with missing collections and make creator nullable with session fields serialized. <sup>Written for commit 2f1bf936ed57aaedad8b4b4cca72a860d337351b. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:44:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5271
No description provided.