JSON Replacer
Clean up escape characters and auto-format mixed JSON/XML content with a single right-click.
Features
Right-click in the editor to open the Json Replacer submenu with two commands:
AutoReplace — Strip escape characters
Remove unnecessary escape sequences from text. Works with JSON, XML, TXT, and other plain text formats:
| Before |
After |
\r\n |
(removed) |
\" |
" |
{\"CityCode\":\"SHA\"} |
{"CityCode":"SHA"} |
<POS><Source CityCode=\"SHA\" /></POS> |
<POS><Source CityCode="SHA" /></POS> |
Parses the document and automatically formats JSON structure and embedded XML content:
- Outer JSON — pretty-printed with indentation
- Embedded JSON strings — promoted to real nested objects
- Embedded XML strings — formatted with proper indentation
- Text content — preserved with readable line breaks
Before
RSP: {"errcode":0,"data":"data...","debugs":["{\"Pos\":[{\"CityCode\":\"SHA\"}]}", ": <RQ><POS><Source CityCode=\"SHA\" /></POS></RQ>"]}
After
RSP:
{
"errcode": 0,
"data": """data...""",
"debugs": [
{
"Pos": [
{
"CityCode": "SHA"
}
]
},
"""<RQ>
<POS>
<Source CityCode="SHA" />
</POS>
</RQ>"""
]
}
Usage
- Open a file in the editor.
- Right-click → Json Replacer submenu:
- AutoReplace — strip
\r\n and \" escape characters
- AutoFormat — format JSON structure with embedded XML/JSON content
Requirements
Changelog
0.0.8 (2026-05-20)
- AutoFormat — new command for smart formatting of mixed JSON/XML content
- Outer JSON pretty-printed with indentation
- Embedded JSON strings promoted to real nested objects (no more
\" escaping)
- Embedded XML strings formatted with proper indentation (supports text prefixes)
- Multi-line text content displayed with
""" delimiters for readability
- Selection support: format only selected text, or entire document if no selection
- Block scanning: works in
.http / .rest files with multiple JSON blocks
- Submenu — right-click context menu restructured into Json Replacer submenu with:
- AutoReplace — existing escape-stripping logic
- AutoFormat — new smart formatting
- Semantic Tokens — mixed syntax highlighting for JSON / XML / HTTP content
- JSON: keys, strings, numbers, booleans, null, structural chars
- XML: tag names, attribute names, attribute values
- HTTP: methods (POST/GET...), headers, comments (
#), variables (@var, {{var}})