More fixes.

This commit is contained in:
Relintai 2022-07-19 19:26:24 +02:00
parent 30c3baba7c
commit d786fb5722
2 changed files with 10 additions and 5 deletions

View File

@ -472,7 +472,8 @@ void BBCodeParser::parse(const String &data) {
// tag
for (int j = i + 1; j < data.size(); ++j) {
if (data[j] == ']') {
Ref<BBCodeParserTag> t = memnew(BBCodeParserTag);
Ref<BBCodeParserTag> t;
t.instance();
t->set_data(data.substr(i, j - i + 1));
t->process();
@ -488,7 +489,8 @@ void BBCodeParser::parse(const String &data) {
for (int j = i + 1; j < data.size(); ++j) {
if (data[j] == '[') {
Ref<BBCodeParserTag> t = memnew(BBCodeParserTag);
Ref<BBCodeParserTag> t;
t.instance();
t->set_data(data.substr(i, j - i));
t->set_type(BBCodeParserTag::BBCODE_PARSER_TAG_TYPE_CONTENT);

View File

@ -531,7 +531,8 @@ void HTMLParser::parse(const String &data) {
for (int j = i + 1; j < data.size(); ++j) {
if (data[j] == '>') {
Ref<HTMLParserTag> t = memnew(HTMLParserTag);
Ref<HTMLParserTag> t;
t.instance();
t->set_data(data.substr(i, j - i + 1));
t->process();
@ -547,7 +548,8 @@ void HTMLParser::parse(const String &data) {
for (int j = i + 1; j < data.size(); ++j) {
if (data[j] == '<') {
Ref<HTMLParserTag> t = memnew(HTMLParserTag);
Ref<HTMLParserTag> t;
t.instance();
t->set_data(data.substr(i, j - i));
t->set_type(HTMLParserTag::HTML_PARSER_TAG_TYPE_CONTENT);
@ -603,7 +605,8 @@ void HTMLParser::parse(const String &data) {
if (done) {
state = STATE_NONE;
Ref<HTMLParserTag> t = memnew(HTMLParserTag);
Ref<HTMLParserTag> t;
t.instance();
t->set_data(data.substr(i, j - i));
t->set_type(HTMLParserTag::HTML_PARSER_TAG_TYPE_CONTENT);