mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
- Updated comments in Probe/Config.ts to use block comments for proxy configuration. - Refactored comments in PortMonitor.ts, SyntheticMonitor.ts, and OnlineCheck.ts to block comments for better readability. - Adjusted comments in ProbeIngest/API/Monitor.ts and ProbeIngest/API/Probe.ts to block comments for clarity. - Standardized comments in various data migration scripts to block comments for consistency. - Modified eslint.config.js to enforce multiline comment style as an error.
31 lines
709 B
TypeScript
31 lines
709 B
TypeScript
export default class HTML {
|
|
private _html: string = "";
|
|
public get html(): string {
|
|
return this._html;
|
|
}
|
|
public set html(v: string) {
|
|
this._html = v;
|
|
}
|
|
|
|
public constructor(html: string) {
|
|
this.html = html;
|
|
}
|
|
|
|
public toString(): string {
|
|
return this.html;
|
|
}
|
|
|
|
public static isHtml(text: string): boolean {
|
|
// Check if the text is HTML
|
|
|
|
/*
|
|
* Example usage const htmlString = '<div>Hello, World!</div>'; const notHtmlString = 'Just a regular string'
|
|
* console.log(HTML.isHtml(htmlString)); // true
|
|
* console.log(HTML.isHtml(notHtmlString)); // false
|
|
*/
|
|
|
|
const htmlPattern: RegExp = /<\/?[a-z][\s\S]*>/i;
|
|
return htmlPattern.test(text);
|
|
}
|
|
}
|