UNPKG

@automattic/social-previews

Version:

A suite of components to generate previews for a post for both social and search engines.

11 lines 742 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tumblrDescription = exports.tumblrTitle = void 0; const helpers_1 = require("../helpers"); const TITLE_LENGTH = 1000; const DESCRIPTION_LENGTH = 400; const tumblrTitle = (text) => (0, helpers_1.firstValid)((0, helpers_1.shortEnough)(TITLE_LENGTH), (0, helpers_1.hardTruncation)(TITLE_LENGTH))((0, helpers_1.stripHtmlTags)(text)) || ''; exports.tumblrTitle = tumblrTitle; const tumblrDescription = (text) => (0, helpers_1.firstValid)((0, helpers_1.shortEnough)(DESCRIPTION_LENGTH), (0, helpers_1.hardTruncation)(DESCRIPTION_LENGTH))((0, helpers_1.stripHtmlTags)(text)) || ''; exports.tumblrDescription = tumblrDescription; //# sourceMappingURL=helpers.js.map