Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/questdb
Submodule questdb updated 105 files
5 changes: 4 additions & 1 deletion src/js/console/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*
******************************************************************************/
import { copyToClipboard } from "../../utils/copyToClipboard"
import { unescapeHtml } from "../../utils/escapeHtml"

const hashString = (str) => {
let hash = 0
Expand Down Expand Up @@ -1153,7 +1154,9 @@ export function grid(rootElement, _paginationFn, id) {
if (cellData !== null) {
const layoutEntry = getLayoutEntry()
const columnWidth = layoutEntry.deviants[column.name] ?? null
cell.textContent = getDisplayedCellValue(column, cellData, columnWidth)
cell.textContent = unescapeHtml(
getDisplayedCellValue(column, cellData, columnWidth),
)

cell.classList.remove("qg-null")

Expand Down
13 changes: 13 additions & 0 deletions src/utils/escapeHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ export const escapeHtml = (text: string): string => {

return text.replace(/[&<>"']/g, (m) => map[m])
}

export const unescapeHtml = (text: string): string => {
const map: Record<string, string> = {
"&amp;": "&",
"&lt;": "<",
"&gt;": ">",
"&quot;": '"',
"&#039;": "'",
"&nbsp;": "\u00A0",
}

return text.replace(/&(amp|lt|gt|quot|#039|nbsp);/g, (m) => map[m])
}