diff --git a/qml/panels/CodeBlock.qml b/qml/panels/CodeBlock.qml index a2acadb..4a0d985 100644 --- a/qml/panels/CodeBlock.qml +++ b/qml/panels/CodeBlock.qml @@ -100,7 +100,7 @@ Rectangle { width: parent.width color: Qt.rgba(0,0,0,0.22) radius: 8 - implicitHeight: codeText.contentHeight + 20 + implicitHeight: codeText.implicitHeight + 20 TextEdit { id: codeText diff --git a/qml/panels/EditorPanel.qml b/qml/panels/EditorPanel.qml index 2182e7b..ad3835f 100644 --- a/qml/panels/EditorPanel.qml +++ b/qml/panels/EditorPanel.qml @@ -8,6 +8,8 @@ Item { signal historyRequested(string path) property alias editorTextArea: textArea + property alias previewView: viewArea + property alias liveView: livePreview property bool sideBySide: false property string viewMode: "edit" // edit, preview, live — per-tab, persisted diff --git a/tests/mdparser_test.cpp b/tests/mdparser_test.cpp index 9787a35..8ecf043 100644 --- a/tests/mdparser_test.cpp +++ b/tests/mdparser_test.cpp @@ -120,8 +120,19 @@ int main(int argc, char *argv[]) QString hl = blocks[1].toMap().value("highlightedText").toString(); if (hl.isEmpty()) hl = blocks[1].toMap().value("highlighted").toString(); if (hl.isEmpty()) return fail("highlighted empty"); + // Debug: print highlighted + std::fprintf(stderr, "highlighted: %s\n", qPrintable(hl.left(500))); } if (blocks[2].toMap().value("type").toString() != "html") return fail("block 2 type"); + // Test with #include + { + auto b2 = p.parseBlocks("```cpp\n#include \nint main() { return 0; }\n```", vault, fileDir); + if (b2.size() != 1 || b2[0].toMap().value("type").toString() != "code") return fail("include block"); + QString hl2 = b2[0].toMap().value("highlightedText").toString(); + if (hl2.isEmpty()) hl2 = b2[0].toMap().value("highlighted").toString(); + std::fprintf(stderr, "hl2: %s\n", qPrintable(hl2.left(800))); + if (!hl2.contains("span")) return fail("hl2 no span", hl2.left(200)); + } std::printf("MDPARSER TEST OK\n"); return 0;