Skip to content

Commit 5ad232e

Browse files
[8.x] [ES|QL] Removes highlighting from script as it is being provided by ES docs already (#215631) (#215720)
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Removes highlighting from script as it is being provided by ES docs already (#215631)](#215631) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-24T14:17:12Z","message":"[ES|QL] Removes highlighting from script as it is being provided by ES docs already (#215631)\n\n## Summary\n\nThis PR elastic/elasticsearch#125251 adds\nhighlighting for the code blocks so it is not needed to be added on the\nkibana side. This PR removes it.\n\nI didnt run the script because it will remove the highlighting. It will\nrun next Monday with @craigtaverner 's PR being merged","sha":"935fc0f7588f0efd06a40a98b929a28933869743","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Removes highlighting from script as it is being provided by ES docs already","number":215631,"url":"https://github.com/elastic/kibana/pull/215631","mergeCommit":{"message":"[ES|QL] Removes highlighting from script as it is being provided by ES docs already (#215631)\n\n## Summary\n\nThis PR elastic/elasticsearch#125251 adds\nhighlighting for the code blocks so it is not needed to be added on the\nkibana side. This PR removes it.\n\nI didnt run the script because it will remove the highlighting. It will\nrun next Monday with @craigtaverner 's PR being merged","sha":"935fc0f7588f0efd06a40a98b929a28933869743"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215631","number":215631,"mergeCommit":{"message":"[ES|QL] Removes highlighting from script as it is being provided by ES docs already (#215631)\n\n## Summary\n\nThis PR elastic/elasticsearch#125251 adds\nhighlighting for the code blocks so it is not needed to be added on the\nkibana side. This PR removes it.\n\nI didnt run the script because it will remove the highlighting. It will\nrun next Monday with @craigtaverner 's PR being merged","sha":"935fc0f7588f0efd06a40a98b929a28933869743"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <[email protected]>
1 parent 4621f30 commit 5ad232e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/platform/packages/private/kbn-language-documentation/scripts/generate_esql_docs.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ function writeFunctionDocs(functionDocs: Map<string, DocsSectionContent>, pathTo
104104
doc.description,
105105
Array.from(functionDocs.keys())
106106
);
107-
const defaultMessage = replaceCodeBlocksForESQLFormatting(docWithoutLinks).replaceAll(
108-
'`',
109-
'\\`'
110-
);
107+
const defaultMessage = docWithoutLinks.replaceAll('`', '\\`');
111108
return `
112109
const foo =
113110
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
@@ -178,10 +175,6 @@ function removeAsciiDocInternalCrossReferences(asciidocString: string, functionN
178175
});
179176
}
180177

181-
function replaceCodeBlocksForESQLFormatting(text: string) {
182-
return text.replace(/```(\n[\s\S]*?\n)```/g, '``` esql$1```');
183-
}
184-
185178
/**
186179
* This function searches the AST for the functions list
187180
*/

0 commit comments

Comments
 (0)