Add function to escape html

This commit is contained in:
Richard Ramos 2020-09-01 15:03:44 -04:00 committed by Michał
parent 895e94d5e1
commit f2590b103f
2 changed files with 7 additions and 0 deletions

View File

@ -105,6 +105,8 @@ DOS_API DosQNetworkConfigurationManager *DOS_CALL dos_qncm_create();
DOS_API char * DOS_CALL dos_plain_text(char* htmlString);
DOS_API char * DOS_CALL dos_escape_html(char* input);
DOS_API void DOS_CALL dos_qncm_delete(DosQNetworkConfigurationManager *vptr);
DOS_API char * DOS_CALL dos_image_resizer(char* imagePath, int maxSize, char* tmpDirPath);

View File

@ -1124,6 +1124,11 @@ char *dos_plain_text(char* htmlString)
return convert_to_cstring(QTextDocumentFragment::fromHtml( htmlString ).toPlainText().toUtf8());
}
char *dos_escape_html(char* input)
{
return convert_to_cstring(QString(input).toHtmlEscaped().toUtf8());
}
char *dos_image_resizer(char* imagePath, int maxSize, char* tmpDirPath)
{
QImage img(imagePath);