mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-15 19:31:39 +00:00
Also fix various variable names to consistently indicate which strings contain HTML. Some of these changes close cross-site scripting vulnerabilities, and others are for consistency. It’s important to be meticulously consistent about escaping so that changes that would introduce vulnerabilities stand out as obviously wrong. Signed-off-by: Anders Kaseorg <anders@zulip.com>
8 lines
209 B
TypeScript
8 lines
209 B
TypeScript
export default class BaseComponent {
|
|
generateNodeFromHTML(html: string): Element | null {
|
|
const wrapper = document.createElement('div');
|
|
wrapper.innerHTML = html;
|
|
return wrapper.firstElementChild;
|
|
}
|
|
}
|