general-functions
Version:
My-Functions
48 lines (41 loc) • 1.51 kB
JavaScript
var striptags = require('striptags');
var html =
'<a href="https://example.com">' +
'lorem ipsum <strong>dolor</strong> <em>sit</em> amet' +
'</a>';
let data={
"prepDateTime": "2021-04-08 18:33:37",
"senderPlatformId": "TRDZYPL",
"senderMessageReference": "20210408SP9Y2F6YA",
"messageType": "saveProject",
"projectName": "WOWSTICK The Metal One-Piece Mini Electric Hand Drill",
"projectDefinition": "<p><span style=\"color: rgb(40, 40, 40);\">hey say the pen is mightier than the sword, and WOWSTICK miniature pen-shaped</span></p>",
"fundCollectionType": "SHRE",
"fundNominalAmount": 500000,
"fundableAmount": 200000,
"additionalFundRate": 40,
"qualifiedFundRate": 40,
"privilege": "<p>YOK</p>",
"projectStartDate": "2021-04-07 00:00:00",
"projectEndDate": "2021-05-07 00:00:00",
"overFunding": "N",
"saveEntrepreneurInfoSet": [
{
"idType": "TCKN",
"id": "15389270128",
"name": "SELMAN",
"surname": "KESKİN",
"entrepreneurType": "L",
"tel": "05419045752",
"email": "turkverisoft@yahoo.com"
}
]
}
var result=[];
result.push(striptags(JSON.stringify(data)))
result.push(striptags(html));
result.push(striptags(html, '<strong>'));
result.push(striptags(html, ['a']));
result.push(striptags(html, [], '\n'));
result.map(x=>console.log(x))
console.log((JSON.parse(result[0])))