MCPcopy
hub / github.com/microfeed/microfeed / htmlToPlainText

Function htmlToPlainText

common-src/StringUtils.js:202–213  ·  view source on GitHub ↗
(htmlStr, options = null)

Source from the content-addressed store, hash-verified

200}
201
202export function htmlToPlainText(htmlStr, options = null) {
203 let convertOptions = {
204 ignoreHref: true,
205 };
206 if (options) {
207 convertOptions = {
208 ...convertOptions,
209 ...options,
210 }
211 }
212 return convert(htmlStr || '', convertOptions);
213}
214
215export function truncateString(str, num, ellipsis = true) {
216 if (str.length > num) {

Callers 3

_decorateForItemMethod · 0.90
htmlMetaDescriptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected