mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 12:25:16 +00:00
Switched to BBCode language for posts.
This commit is contained in:
@ -416,6 +416,10 @@ function checkString(value){
|
||||
*/
|
||||
function removeHtmlTags(input){
|
||||
|
||||
//Check if input string is empty
|
||||
if(input == null)
|
||||
return "";
|
||||
|
||||
//Prepare update
|
||||
var output = input;
|
||||
|
||||
@ -435,6 +439,25 @@ function removeHtmlTags(input){
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all line break with paragraph tags
|
||||
*
|
||||
* @param {string} input Input string to convert
|
||||
* @return {string} Generated string
|
||||
*/
|
||||
function lineBreakToPTags(input){
|
||||
|
||||
//Check if the string is empty
|
||||
if(input == null || input == "")
|
||||
return input;
|
||||
|
||||
//Change string
|
||||
while(input.includes("\n"))
|
||||
input = input.replace("\n", "</p><p>");
|
||||
|
||||
return "<p>"+input+"</p>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a URL validity
|
||||
*
|
||||
|
Reference in New Issue
Block a user