MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / htmlify

Function htmlify

src/js/core/Util.js:460–468  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

458}
459
460export function htmlify(str) {
461 //if (str.match(/<\s*p[^>]*>([^<]*)<\s*\/\s*p\s*>/)) {
462 if (str.match(/<p>[\s\S]*?<\/p>/)) {
463
464 return str;
465 } else {
466 return "<p>" + str + "</p>";
467 }
468}
469
470export function unhtmlify(str) {
471 str = str.replace(/(<[^>]*>)+/g, '');

Callers 1

_initLayoutMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected