nehan
Version:
Html layout engine for paged-media written in Typescript
24 lines • 696 B
JavaScript
import { CssCascade, Config, } from "./public-api";
export class WhiteSpace {
constructor(value) {
this.value = value;
}
isPre() {
return this.value === 'pre';
}
static load(element) {
let value = CssCascade.getValue(element, "white-space");
return new WhiteSpace(value);
}
static isWhiteSpaceElement(element) {
if (!element.isTextElement()) {
return false;
}
let text = element.textContent;
if (Config.nonOmitWhiteSpaces.some(chr => text.indexOf(chr) >= 0)) {
return false;
}
return text.replace(/\s/gm, "") === "";
}
}
//# sourceMappingURL=white-space.js.map