Small html cleanup

This commit is contained in:
James Grogan 2022-12-01 11:49:57 +00:00
parent c102ebb6da
commit 31b479e9f6
27 changed files with 330 additions and 252 deletions

View file

@ -17,4 +17,14 @@ I'm a bullet point list:
* Second point
* Third point
With a [hyperlink](www.imahyperlink.com) embedded.
With a [hyperlink](www.imahyperlink.com) embedded.
# I'm another level one header
I'm some inline math $a = b + c$ and I'm some standalone math:
$$
d = e + f
$$
![This is an image](https://myoctocat.com/assets/images/base-octocat.svg)

View file

@ -1,5 +1,6 @@
set(PUBLISHING_UNIT_TEST_FILES
publishing/TestPdfWriter.cpp
publishing/TestDocumentConverter.cpp
PARENT_SCOPE
)

View file

@ -0,0 +1,19 @@
#include "PdfDocument.h"
#include "PdfWriter.h"
#include "PdfObject.h"
#include "File.h"
#include "TestFramework.h"
#include "TestUtils.h"
TEST_CASE(TestDocumentConverterMarkdownToPdf, "publishing")
{
auto document = std::make_unique<PdfDocument>();
PdfWriter writer;
const auto output = writer.ToString(document);
File pdf_file(TestUtils::getTestOutputDir() / "TestDocumentConverterMarkdownToPdf.pdf");
pdf_file.open(File::AccessMode::Write);
pdf_file.writeText(output);
}

View file

@ -16,7 +16,7 @@ TEST_CASE(TestMarkdownParser, "web")
auto html = parser.getHtml();
HtmlWriter writer;
const auto html_string = writer.ToString(html);
const auto html_string = writer.toString(html.get());
File html_file(TestUtils::getTestOutputDir() / "TestMarkdownParserOut.html");
html_file.writeText(html_string);

View file

@ -3,6 +3,8 @@
#include "XmlParser.h"
#include "XmlWriter.h"
#include "XmlDocument.h"
#include "File.h"
#include "TestFramework.h"
@ -18,12 +20,12 @@ TEST_CASE(TestXmlParser, "web")
{
std::string line;
std::getline(xml_file, line);
parser.ProcessLine(line);
parser.processLine(line);
}
xml_file.close();
XmlWriter writer;
auto content = writer.ToString(parser.GetDocument().get());
auto content = writer.toString(parser.getDocument().get());
auto outFile = std::make_unique<File>(TestUtils::getTestOutputDir() / "test_out.xml");
outFile->writeText(content);