mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-23 23:02:08 +03:00
Lexical: Finished off core cell properties functionality
This commit is contained in:
@@ -21,4 +21,12 @@ export function el(tag: string, attrs: Record<string, string | null> = {}, child
|
||||
export function htmlToDom(html: string): Document {
|
||||
const parser = new DOMParser();
|
||||
return parser.parseFromString(html, 'text/html');
|
||||
}
|
||||
|
||||
export function formatSizeValue(size: number | string, defaultSuffix: string = 'px'): string {
|
||||
if (typeof size === 'number' || /^-?\d+$/.test(size)) {
|
||||
return `${size}${defaultSuffix}`;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
Reference in New Issue
Block a user