diff --git a/tools/doc/json.js b/tools/doc/json.js
index bac2454e7904f0..9eceefb2df1f0f 100644
--- a/tools/doc/json.js
+++ b/tools/doc/json.js
@@ -235,8 +235,7 @@ function processList(section) {
                         `${JSON.stringify(tok)}\n` +
                         JSON.stringify(list));
       }
-      current.textRaw = current.textRaw || '';
-      current.textRaw += `${tok.text} `;
+      current.textRaw = `${current.textRaw || ''}${tok.text} `;
     }
   });