(str)
| 458 | } |
| 459 | |
| 460 | export 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 | |
| 470 | export function unhtmlify(str) { |
| 471 | str = str.replace(/(<[^>]*>)+/g, ''); |