diff --git a/bonus2/res/test.html b/bonus2/res/test.html
index feaf3e3..fe9aea4 100644
--- a/bonus2/res/test.html
+++ b/bonus2/res/test.html
@@ -13,7 +13,7 @@ Did you ever hear the tragedy of
Darth Plagueis The Wise?
I thought not
. It’s not a story the Jedi would tell you.
It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith,
-so powerful and so wise he could use the Force to influence the midichlorians to create life…
+so powerful & so wise he could use the Force to influence the midichlorians to create life…
He had such a knowledge of the dark side that he could even keep the ones he cared about from dying.
The dark side of the Force is a pathway to many abilities some consider to be unnatural.
He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did.
@@ -38,7 +38,7 @@ Unfortunately, he taught his apprentice everything he knew, then his apprentice
The | diff --git a/bonus2/src/ch/usi/inf/atelier/group1/HtmlParser.kt b/bonus2/src/ch/usi/inf/atelier/group1/HtmlParser.kt index f14b77f..6b01a06 100644 --- a/bonus2/src/ch/usi/inf/atelier/group1/HtmlParser.kt +++ b/bonus2/src/ch/usi/inf/atelier/group1/HtmlParser.kt @@ -60,6 +60,7 @@ class HtmlParser(private val singlePage: Boolean) { changeMono() changeParagraph() changeSection() + changeSpecials() changeSubSection() changeSubSubSection() changeTable() diff --git a/bonus2/src/ch/usi/inf/atelier/group1/jekyll/HtmlToLatexWriter.kt b/bonus2/src/ch/usi/inf/atelier/group1/jekyll/HtmlToLatexWriter.kt index 85e70e3..4b49db4 100644 --- a/bonus2/src/ch/usi/inf/atelier/group1/jekyll/HtmlToLatexWriter.kt +++ b/bonus2/src/ch/usi/inf/atelier/group1/jekyll/HtmlToLatexWriter.kt @@ -139,6 +139,15 @@ class HtmlToLatexWriter(private var content: String, private val singlePage: Boo if (singlePage) "\\subsection{" else "\\section{", "}\n") } + /** + * Replace special html chars with LaTeX equivalents + */ + fun changeSpecials() { + HTML_SPECIALS_FROM.forEachIndexed { index, s -> + content = content.replace(s, HTML_SPECIALS_TO[index]) + } + } + /** * Replace
---|