31 #ifndef PARSING_HTML_HPP_ 32 #define PARSING_HTML_HPP_ 34 #include "../Main/Exception.hpp" 35 #include "../Wrapper/TidyDoc.hpp" 39 #include <string_view> 84 virtual ~HTML() =
default;
94 std::queue<std::string>& warningsTo
175 std::queue<std::string>& warningsTo
181 this->doc.
setOption(TidyNumEntities,
true);
183 this->doc.
setOption(TidyShowWarnings, warnings);
184 this->doc.
setOption(TidyForceOutput,
true);
185 this->doc.
setOption(TidyDropEmptyElems,
false);
186 this->doc.
setOption(TidyShowErrors, numOfErrors);
189 this->doc.
parse(inOut, warningsTo);
192 const auto output(this->doc.
getOutput(warningsTo));
void setOption(TidyOptionId option, bool value)
Sets a boolean option.
Definition: TidyDoc.hpp:296
HTML & operator=(HTML &)=delete
Deleted copy operator.
void tidyAndConvert(std::string &inOut, bool warnings, ulong numOfErrors, std::queue< std::string > &warningsTo)
Parse and tidy the given HTML markup and convert the result to XML.
Definition: HTML.hpp:171
constexpr std::string_view tidyEncoding
The character encoding used by the tidy-html5 API.
Definition: HTML.hpp:52
#define MAIN_EXCEPTION_CLASS()
Macro used to easily define classes for general exceptions.
Definition: Exception.hpp:50
RAII wrapper for documents used by the tidy-html5 API.
Definition: TidyDoc.hpp:70
void parse(const std::string &in, std::queue< std::string > &warningsTo)
Parses the given markup.
Definition: TidyDoc.hpp:441
Parses and cleans HTML markup.
Definition: HTML.hpp:71
Namespace for classes parsing HTML, URIs, and XML.
Definition: HTML.hpp:42
std::string getOutput(std::queue< std::string > &warningsTo)
Gets the processed text from the tidy-html5 document.
Definition: TidyDoc.hpp:221
virtual ~HTML()=default
Default destructor.
Class for tidy-html5 document exceptions.
Definition: TidyDoc.hpp:118
void cleanAndRepair(std::queue< std::string > &warningsTo)
Cleans and repairs the previously parsed content of the underlying tidy-html5 document.
Definition: TidyDoc.hpp:505
Class for HTML exceptions.
Definition: HTML.hpp:107
HTML()=default
Default constructor.