UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

20 lines 1.18 kB
/** * 2025-01-17: Migrated from SP-API-Tester * The purpose of this function is to * 1. Take a rich text field from a list item * 2. Strip any Div tags from the string * if onlyStripOutterTags === true, then it only strips the outter HTML tags from the RichText field * if you set this to false, it may also strip any inner tags from things like analytics with rich text tags in the json * onlyStripOutterTags has only been tested in it's default state for SP-API-Tester * For example... zzzRichText1: '<div class="ExternalClassA265D727B17142199E957A374E3FD155">{html: "<span>Hello</span>" }' * onlyStripOutterTags === true should return: {html: "<span>Hello</span>" } * onlyStripOutterTags !== true should return: {html: "Hello" } * 3. Decode any Html Entities * 4. Try to convert the remaining string into a JSON object * * @param richTextValue * @param onlyStripOutterTags * @returns */ export declare function parseRichTextFieldAsJsonObject(richTextValue: string, onlyStripOutterTags?: boolean): any; //# sourceMappingURL=parseRichTextFieldAsJsonObject.d.ts.map