diff --git a/3rdparty/s7/s7.h b/3rdparty/s7/s7.h index e1b209aa87..8d71e658ff 100644 --- a/3rdparty/s7/s7.h +++ b/3rdparty/s7/s7.h @@ -12,7 +12,7 @@ typedef int64_t s7_int; typedef double s7_double; #ifndef __cplusplus -#ifndef _MSC_VER +#if !defined(_MSC_VER) || (_MSC_VER >= 1800) #include #else #ifndef true diff --git a/src/Data/Convert/Generic/input.cpp b/src/Data/Convert/Generic/input.cpp index b193724beb..1b59096f81 100644 --- a/src/Data/Convert/Generic/input.cpp +++ b/src/Data/Convert/Generic/input.cpp @@ -15,6 +15,7 @@ #include "file.hpp" #include "hashmap.hpp" #include "image_files.hpp" +#include "Markdown/markdown.hpp" #include "moebius/data/scheme.hpp" #include "path.hpp" #include "preferences.hpp" @@ -310,7 +311,7 @@ void texmacs_input_rep::markdown_flush (bool force) { // ignore: empty buf in markdown is meaningless if (force && !is_empty (buf)) { - write (generic_to_tree (buf, "markdown-snippet")); + write (markdown_to_tree (buf)); buf= ""; } } diff --git a/src/Data/Convert/Markdown/markdown.cpp b/src/Data/Convert/Markdown/markdown.cpp new file mode 100644 index 0000000000..6af1a6e9df --- /dev/null +++ b/src/Data/Convert/Markdown/markdown.cpp @@ -0,0 +1,18 @@ +/****************************************************************************** + * MODULE : markdown.cpp + * DESCRIPTION: Markdown to TMU tree conversion (Placeholder) + ******************************************************************************/ + +#include "markdown.hpp" + +#include "md4c.h" // Testing md4c include +#include "tree_helper.hpp" + +tree +markdown_to_tree (string s) { + // TODO: Phase 2 - Implement md4c AST parsing and mapping to Mogan's tree + // For now, this is a placeholder that returns a basic verbatim tree or text + // just to prove the C++ binding and build works. + + return tree (TUPLE, "document", s); +} diff --git a/src/Data/Convert/Markdown/markdown.hpp b/src/Data/Convert/Markdown/markdown.hpp new file mode 100644 index 0000000000..757ea8d81c --- /dev/null +++ b/src/Data/Convert/Markdown/markdown.hpp @@ -0,0 +1,13 @@ +/****************************************************************************** + * MODULE : markdown.hpp + * DESCRIPTION: Markdown to TMU tree conversion (Placeholder) + ******************************************************************************/ + +#ifndef MARKDOWN_H +#define MARKDOWN_H + +#include "tree.hpp" + +tree markdown_to_tree (string s); + +#endif // defined MARKDOWN_H diff --git a/xmake.lua b/xmake.lua index 3d1541d0ba..7e5b5bb6fa 100644 --- a/xmake.lua +++ b/xmake.lua @@ -232,6 +232,7 @@ add_requires("freetype "..FREETYPE_VERSION, {system=false, configs={png=true}}) add_requireconfs("liii-pdfhummus.freetype", {version = FREETYPE_VERSION, system = false, configs={png=true}, override=true}) add_requires("argh v1.3.2") +add_requires("md4c") --- package: qt6widgets QT6_VERSION="6.8.3" @@ -638,6 +639,7 @@ target("libmogan") do add_packages("freetype") add_packages("s7") add_packages("argh") + add_packages("md4c") if not is_plat("macosx") then add_packages("libiconv") end