<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65400>65400</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format outputs broken JSON in raw string literals
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AdamBucior
</td>
</tr>
</table>
<pre>
`clang-format` breaks content of raw string literals containing JSON.
```
C:\bug>clang-format --version
clang-format version 18.0.0 (https://github.com/llvm/llvm-project.git c8544d280a8ef1e41efc5c036e00dc671edbb93d)
C:\bug>type .clang-format
BasedOnStyle: LLVM
RawStringFormats:
- Language: Json
Delimiters: [json]
C:\bug>type test.cpp
void foo() {
const char *json = R"json({
"str": "test"
})json";
}
C:\bug>clang-format -style=file test.cpp
void foo() {
const char *json = R"json(tr": "test" })json";
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU09v2z4M_TT0hYghU_578CGpfzkU_a1AC-wu24qjVpECSW7Rbz9YTrcG64YNGBAgEB8f-fhMCu_VZKRsodhB0SViDkfr2u0oTrt5UNYlvR3fWijZoIWZNgfrTiJAybB3Ujx7HKwJ0gS0B3TiFX1wykyoVZBO6BUWyiyx28f7LymwDtgWSnb5xecN8C0UN_08Af_vYx_cbF6k88qaNfEKuyCY1SlLGQLVxxDOfqlFe6D9pMJx7tPBnoD2Wr-8_23Ozj7JIaSTCjjURZ6PVDNRy0Mm80wehmJgvJSMjUNZZXLs-4aPQM1F-s-Kw9tZYnrlT0zaCS_He_MY3rQEvsW7u6__r8iDeH2MRu1jetQcAcQN3gkzzWKKlFv_PjoiYie1Oi3OLgSEYve0wEX3e2VB-pAO5_OKv1g14sFaoBqoQah27_UHa3zA4SgcAm2X0gi8wwcgin2o_pCMCEQ-OCCKWoiWNstrTYCqA2pWHgG_8Jbor7Ref3e_mtYdlP6XE3wi-M-kft_YZGz52PBGJLLNyoY3eVbVLDm2VZNleVlJnlFfjXlW5vV44ENeZ4L6qikT1RIjzhpWZA1xxtKeJM-LYuRF2ZNgDeRMnoTS6bKlqXVToryfZVsWOWOJFr3UPt4p0dWyEQHdAJGRrxgZS6ToEtfGde_nyUPOtPLB_ygdVNCyvTLdzuE8B4-9s8_SxHtFZT4762R2uv27awPaR20eaB8H-hYAAP__BLVVRg">