Switched to BBCode language for posts.

This commit is contained in:
Pierre HUBERT
2018-12-27 14:02:01 +01:00
parent f6e2c83dbd
commit 2890b03283
32 changed files with 573 additions and 18 deletions

View File

@ -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
*