From ed7a63015c1583d5544ac18bbaccaedc95f3e5e3 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 8 Nov 2019 19:49:40 +0300 Subject: [texo] Full rewrite of inner representation. --- src/html.hpp | 70 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/html.hpp') 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(); }; -- cgit v1.2.3