summaryrefslogtreecommitdiff
path: root/src/html.hpp
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-11-08 19:49:40 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-11-08 19:49:40 +0300
commited7a63015c1583d5544ac18bbaccaedc95f3e5e3 (patch)
tree9648d5a74bae9cbd90670a8bfa0af47189e4536f /src/html.hpp
parentc6419eed96f2832b1de2b94d711552efaa9b172d (diff)
downloadtexo-ed7a63015c1583d5544ac18bbaccaedc95f3e5e3.tar
texo-ed7a63015c1583d5544ac18bbaccaedc95f3e5e3.tar.xz
texo-ed7a63015c1583d5544ac18bbaccaedc95f3e5e3.zip
[texo] Full rewrite of inner representation.
Diffstat (limited to 'src/html.hpp')
-rw-r--r--src/html.hpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/html.hpp b/src/html.hpp
index b96200f..aa22cf1 100644
--- a/src/html.hpp
+++ b/src/html.hpp
@@ -6,44 +6,44 @@
#include "importer.hpp"
-class TexoProducerHTML: public TexoProducer {
+class TexoProducerHTML: public TexoProducerStrict {
public:
TexoProducerHTML(TexoExporter &exporter);
- void End();
-
- void Put(const Texo &piece);
-
- void Put(const TexoHeader &piece);
- void Put(const TexoParagraph &piece);
- void Put(const TexoCode &piece);
- void Put(const TexoQuote &piece);
-
- void Put(const TexoMono &piece);
- void Put(const TexoBold &piece);
- void Put(const TexoItalic &piece);
- void Put(const TexoUnderline &piece);
- void Put(const TexoStrike &piece);
-
- void Put(const TexoImage &piece);
- void Put(const TexoLink &piece);
- void Put(const TexoHorizontalRule &piece);
-
-private:
- void Close();
-
- enum {
- none = 0,
- header_1,
- header_2,
- header_3,
- header_4,
- header_5,
- header_6,
- paragraph,
- code,
- quote
- } opened_block;
+protected:
+ bool TruePut(char c);
+
+ bool StartCode();
+ bool StartHeader(int level);
+ bool StartParagraph();
+ bool StartQuote();
+
+ bool CloseCode();
+ bool CloseHeader(int level);
+ bool CloseParagraph();
+ bool CloseQuote();
+
+ bool StartBold();
+ bool StartItalic();
+ bool StartMono();
+ bool StartStrike();
+ bool StartUnderline();
+
+ bool CloseBold();
+ bool CloseItalic();
+ bool CloseMono();
+ bool CloseStrike();
+ bool CloseUnderline();
+
+ bool StartLink(const ScriptVariable &link, const ScriptVariable &title);
+ bool CloseLink(const ScriptVariable &link, const ScriptVariable &title);
+
+ bool TruePutImage(
+ const ScriptVariable &src,
+ const ScriptVariable &alt,
+ const ScriptVariable &title
+ );
+ bool TruePutHorizontalRule();
};