aboutsummaryrefslogtreecommitdiffstats
path: root/include/markdown_translator.hpp
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-10-28 01:38:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-10-28 01:38:28 -0700
commit84459bd663f62c2d1e83c7f47aa8bc96eb6543e2 (patch)
treecc4dcf06f212f0f0e7775708ec3dcdc52f8b0791 /include/markdown_translator.hpp
parent16208f6f3b499103a19b1c3ae61d1cfd71ca102b (diff)
move regex to header file
Diffstat (limited to 'include/markdown_translator.hpp')
-rw-r--r--include/markdown_translator.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/markdown_translator.hpp b/include/markdown_translator.hpp
index 6c0c1bc..6a3b91f 100644
--- a/include/markdown_translator.hpp
+++ b/include/markdown_translator.hpp
@@ -17,6 +17,12 @@ public:
std::string processLine(const std::string& line);
private:
+ // Regex for various tags
+ const std::string headerRegexStr{"^(#{1,6})\\s+(.*)$"};
+ const std::string boldRegexStr{"\\*\\*([^\\*]+)\\*\\*|__([^_]+)__"};
+ const std::string italicRegexStr{"\\*([^\\*]+)\\*|_([^_]+)_"};
+ const std::string linkRegexStr{"\\[([^\\]]+)\\]\\(([^\\)]+)\\)"};
+ const std::string imageRegexStr{"!\\[(.*?)\\]\\(([^\\s\"]+)(\\s+\"(.*?)\")?\\)"};
// Helper functions for different markdown elements
void processMetadata(const std::vector<std::string>& lines);
std::string processHeaders(const std::string& line);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage