Skip to content

Commit c5cf4f7

Browse files
authored
[clang][doc] Don't escape _ in .rst files. (#65277)
The current generated ClangCommandLineReference.rst unconditionally escapes underscores. This leads odd output on the website https://clang.llvm.org/docs/ClangCommandLineReference.html For example -fchar8\_t, -fno-char8\_t Whether an underscore should be escaped depends on the state. Currently the escape routine doesn't keep track of the state and currently underscores are not used in places where they need to be escaped. Therefore remove the underscore from the list of escaped characters.
1 parent 09b8bbd commit c5cf4f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/utils/TableGen/ClangOptionDocEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ unsigned getNumArgsForKind(Record *OptionKind, const Record *Option) {
194194
std::string escapeRST(StringRef Str) {
195195
std::string Out;
196196
for (auto K : Str) {
197-
if (StringRef("`*|_[]\\").count(K))
197+
if (StringRef("`*|[]\\").count(K))
198198
Out.push_back('\\');
199199
Out.push_back(K);
200200
}

0 commit comments

Comments
 (0)