You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encode markdown formatted fields to prevent issues with >, <, and $ (#500)
This PR introduces an encoding utility for Markdown used in all work
item creation/update paths to prevent truncation/corruption when <, >,
and ${), appear in Markdown fields.
### Previously
<img width="1476" height="952" alt="image"
src="https://github.com/user-attachments/assets/fc15de30-1778-4034-9209-02a77b392da1"
/>
### With this change
<img width="1478" height="1042" alt="image"
src="https://github.com/user-attachments/assets/5a6cf713-4000-47df-b6b9-4e40ce6e5bb2"
/>
## GitHub issue number
## **Associated Risks**
The user may intend to use `>`,`<`,`$` for their Markdown.
* However, it's **signficantly** more likely the user will be using
GitHub Copilot or another AI coding tool, which the models tend to use
`<` and `>` to represent greater than some value (instead of intending
to use it as html embedded in Markdown).
## ✅ **PR Checklist**
- [x] **I have read the [contribution
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)**
- [x] **I have read the [code of conduct
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)**
- [x] Title of the pull request is clear and informative.
- [x] 👌 Code hygiene
- [x] 🔭 Telemetry added, updated, or N/A
- [x] 📄 Documentation added, updated, or N/A
- [x] 🛡️ Automated tests added, or N/A
## 🧪 **How did you test it?**
I wrote tests and provided the following to Claude Sonnet 4 and GPT-5
both before and after this change:
````
Try creating a Markdown epic again with the following field values:
tool : mcp_ado_wit_create_work_item
args : {
"fields": [
{
"name": "System.Title",
"value": "Test Epic #3 - Comparison Operators < > in Metrics"
},
{
"format": "Markdown",
"name": "System.Description",
"value": "This epic tests comparison operators in metric contexts:
## Metric Examples
- Example Metric: <5 of something
- Another Example Metric: >6 of something
- One Last Metric: <7 of something >8 of something
## Additional Test Cases
- Performance requirement: Response time <500ms
- Throughput requirement: Handle >1000 requests per second
- Memory usage: Keep memory <2GB but >1GB for optimal performance
- Error rate: Maintain error rate <1% and uptime >99.9%
## Code Context
```bash
if [ $count -lt 5 ]; then
echo \"Count is <5\"
elif [ $count -gt 6 ]; then
echo \"Count is >6\"
fi
```
Testing how these comparison operators are handled in various contexts."
}
],
"project": "REPLACE-ME",
"workItemType": "Epic"
}
````
---------
Co-authored-by: Dan Hellem <dahellem@microsoft.com>
0 commit comments