Files
nocodb/packages/nc-gui/utils/stringUtils.ts
2025-07-29 13:41:07 +00:00

11 lines
332 B
TypeScript

export function getHTMLEncodedText(htmlString: string) {
const div = document.createElement('div')
div.textContent = htmlString || ''
return div.innerHTML
}
export const truncateText = (text: string, maxLength: number = 50) => {
if (text.length <= maxLength) return text
return `${text.substring(0, maxLength - 3)}...`
}