[PR #799] [MERGED] Fix JSON Marshal Escaping for Special Characters #20872

Closed
opened 2026-04-19 15:17:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/799
Author: @deichbewohner
Created: 10/16/2023
Status: Merged
Merged: 10/17/2023
Merged by: @mxyng

Base: mainHead: jsonmarshaling


📝 Commits (2)

  • ee94693 handling unescaped json marshaling
  • 8fa3f36 Removed newline trimming and used buffer directly in POST request.

📊 Changes

1 file changed (+8 additions, -4 deletions)

View changed files

📝 llm/llama.go (+8 -4)

📄 Description

Fixed the json.Marshal() behavior in llama.go to prevent automatic escaping of special characters like < and >. This ensures templates with these characters are correctly represented in the JSON output. Addresses issue https://github.com/jmorganca/ollama/issues/798


🔄 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/ollama/ollama/pull/799 **Author:** [@deichbewohner](https://github.com/deichbewohner) **Created:** 10/16/2023 **Status:** ✅ Merged **Merged:** 10/17/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `jsonmarshaling` --- ### 📝 Commits (2) - [`ee94693`](https://github.com/ollama/ollama/commit/ee94693b1aa4de1f9d7ee601306d38277144e5fd) handling unescaped json marshaling - [`8fa3f36`](https://github.com/ollama/ollama/commit/8fa3f366ad0491d1e53fc0b2a87bb6f048b1e8ab) Removed newline trimming and used buffer directly in POST request. ### 📊 Changes **1 file changed** (+8 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `llm/llama.go` (+8 -4) </details> ### 📄 Description Fixed the json.Marshal() behavior in llama.go to prevent automatic escaping of special characters like < and >. This ensures templates with these characters are correctly represented in the JSON output. Addresses issue https://github.com/jmorganca/ollama/issues/798 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 15:17:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20872