[Trunk | Admin]: div-help-contents.component & page-help-contents.component: Add regex to replace multiple spaces, new lines and tabs with one space.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56784 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
80ec909e4d
commit
4098e68852
|
@ -294,6 +294,7 @@ export class DivHelpContentsComponent implements OnInit {
|
|||
|
||||
public cutContent(divHelpContent: DivHelpContent) {
|
||||
divHelpContent.content = divHelpContent.content.replace(/<[^>]*>/g, '');
|
||||
divHelpContent.content = divHelpContent.content.replace(/(\r\n|\n|\r| +(?= ))|\s\s+/gm," ");
|
||||
if(divHelpContent.content.length > 200) {
|
||||
divHelpContent.content = divHelpContent.content.substr(0, 200) + "...";
|
||||
}
|
||||
|
|
|
@ -303,6 +303,8 @@ export class PageHelpContentsComponent implements OnInit {
|
|||
|
||||
public cutContent(pageHelpContent: PageHelpContent) {
|
||||
pageHelpContent.content = pageHelpContent.content.replace(/<[^>]*>/g, '');
|
||||
pageHelpContent.content = pageHelpContent.content.replace(/(\r\n|\n|\r| +(?= ))/gm," ");
|
||||
console.info(pageHelpContent.content.length, pageHelpContent.content);
|
||||
if(pageHelpContent.content.length > 200) {
|
||||
pageHelpContent.content = pageHelpContent.content.substr(0, 200) + "...";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue