tm-content-parser
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -201,2 +201,3 @@ "use strict"; | ||
replaceEntityTags, | ||
removeNewlinesFromLists, | ||
replaceNewLineCharacters, | ||
@@ -227,2 +228,4 @@ formatHtml | ||
const removeNewlinesFromLists = R.replace(/\/li>([^<]+)<li>/g, '\/li><li>'); | ||
const replaceNewLineCharacters = R.replace(/\n/g, '<br>'); | ||
@@ -229,0 +232,0 @@ |
{ | ||
"name": "tm-content-parser", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Trinity Mirror Content Type Parser", | ||
@@ -31,3 +31,3 @@ "main": "index.js", | ||
], | ||
"dependencies":{ | ||
"dependencies": { | ||
"cheerio": "0.22.0", | ||
@@ -49,3 +49,3 @@ "co": "4.6.0", | ||
}, | ||
"tmAppsNode":"6.10.3" | ||
"tmAppsNode": "6.10.3" | ||
} |
@@ -107,2 +107,16 @@ "use strict"; | ||
describe('.removeNewlinesFromLists', () => { | ||
const removeNewlinesFromLists = contentTypeParser.__get__("removeNewlinesFromLists"); | ||
it('should replace new line characters with correct html tags', () => { | ||
removeNewlinesFromLists( | ||
'<p>This is a paragraph with \n new \n lines \n <ul><li>Coffee</li>\n<li>Tea</li>\n<li>Milk</li></ul></p>' | ||
).should.eql( | ||
'<p>This is a paragraph with \n new \n lines \n <ul><li>Coffee</li><li>Tea</li><li>Milk</li></ul></p>' | ||
); | ||
}); | ||
}); | ||
describe('.replaceNewLineCharacters', () => { | ||
@@ -109,0 +123,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69872
1378