Fix TRIM help broken in Console SQL Editor (#11628)

* delete escape

* bug fix

Co-authored-by: yuanyi <yuanyi@freewheel.tv>
This commit is contained in:
Yi Yuan 2021-08-30 13:04:35 +08:00 committed by GitHub
parent ec6c6e2d53
commit ca5e55cc8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -30,6 +30,10 @@ function unwrapMarkdownLinks(str) {
return str.replace(/\[([^\]]+)\]\([^)]+\)/g, (_, s) => s);
}
function deleteBackticks(str) {
return str.replace(/`/g, "");
}
const readDoc = async () => {
const data = await fs.readFile(readfile, 'utf-8');
const lines = data.split('\n');
@ -41,8 +45,8 @@ const readDoc = async () => {
if (functionMatch) {
functionDocs.push([
functionMatch[1],
functionMatch[2],
unwrapMarkdownLinks(functionMatch[3]),
deleteBackticks(functionMatch[2]),
deleteBackticks(unwrapMarkdownLinks(functionMatch[3])),
// functionMatch[4] would be the default column but we ignore it for now
]);
}

View File

@ -126,7 +126,7 @@ export class QueryInput extends React.PureComponent<QueryInputProps, QueryInputS
static makeDocHtml(item: any) {
return `
<div class="doc-name">${escape(item.caption)}</div>
<div class="doc-syntax">${escape(item.syntax)}</div>
<div class="doc-syntax">${item.syntax}</div>
<div class="doc-description">${escape(item.description)}</div>`;
}