mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 21:52:18 +00:00
Fix(ts): escape doc comment terminator in generated JSDoc (#8820)
This commit is contained in:
@@ -362,7 +362,13 @@ class TsGenerator : public BaseGenerator {
|
|||||||
code += "/**\n";
|
code += "/**\n";
|
||||||
for (auto it = dc.begin(); it != dc.end(); ++it) {
|
for (auto it = dc.begin(); it != dc.end(); ++it) {
|
||||||
if (indent) code += indent;
|
if (indent) code += indent;
|
||||||
code += " *" + *it + "\n";
|
std::string safe = *it;
|
||||||
|
for (size_t pos = 0;
|
||||||
|
(pos = safe.find("*/", pos)) != std::string::npos;) {
|
||||||
|
safe.replace(pos, 2, "*\\/");
|
||||||
|
pos += 3;
|
||||||
|
}
|
||||||
|
code += " *" + safe + "\n";
|
||||||
}
|
}
|
||||||
if (indent) code += indent;
|
if (indent) code += indent;
|
||||||
code += " */\n";
|
code += " */\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user