mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Moved newline_to_br helper from Utils to String.
This commit is contained in:
parent
b9afc6f201
commit
d1e8def48d
@ -6,11 +6,6 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
void Utils::newline_to_br(String *str) {
|
||||
str->replace("\r\n", "<br>");
|
||||
str->replace("\n", "<br>");
|
||||
}
|
||||
|
||||
void Utils::markdown_to_html(String *str) {
|
||||
std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
|
||||
config->isEmphasizedParserEnabled = false;
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
class Utils {
|
||||
public:
|
||||
static void newline_to_br(String *str);
|
||||
//htmlspecialchars
|
||||
|
||||
static void markdown_to_html(String *str);
|
||||
|
||||
static String get_pagination(const String &base_url, const uint32_t max, const uint32_t current_index, const uint32_t max_visible_links = 10);
|
||||
|
@ -1059,6 +1059,11 @@ void String::from_html_special_chars() {
|
||||
replace(">", ">");
|
||||
}
|
||||
|
||||
void String::newline_to_br() {
|
||||
replace("\r\n", "<br>");
|
||||
replace("\n", "<br>");
|
||||
}
|
||||
|
||||
bool String::to_bool() const {
|
||||
if (_size == 0) {
|
||||
return 0;
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
|
||||
void to_html_special_chars();
|
||||
void from_html_special_chars();
|
||||
void newline_to_br();
|
||||
|
||||
bool to_bool() const;
|
||||
float to_float() const;
|
||||
|
Loading…
Reference in New Issue
Block a user