@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
12 lines (11 loc) • 560 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
createShowMoreHtml: (text, length) => {
const sanitizedString = text ? text.replace(/"/g, "'") : '';
const stringLength = length || 100;
return `<div class="dpr-show-more" data-content="${sanitizedString}" data-dpr-module="show-more" data-length="${stringLength}">
<div class='dpr-show-more-content'>${sanitizedString}</div><a class="dpr-show-hide-button govuk-link--no-visited-state" href="#">show more</a>
</div>`;
},
};