From 9fc6e775aa36fa924c8320b069b8d88cd7dfc626 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 6 Jul 2025 14:40:52 +0200 Subject: [PATCH] markdown editor fixes --- cookbook/helper/mdx_attributes.py | 6 ++-- vue3/src/components/display/Instructions.vue | 34 +++++++++++++++++++ .../components/inputs/StepMarkdownEditor.vue | 32 +++++++++++++++-- 3 files changed, 67 insertions(+), 5 deletions(-) diff --git a/cookbook/helper/mdx_attributes.py b/cookbook/helper/mdx_attributes.py index d9a62c26f..19d081617 100644 --- a/cookbook/helper/mdx_attributes.py +++ b/cookbook/helper/mdx_attributes.py @@ -6,8 +6,10 @@ class StyleTreeprocessor(Treeprocessor): def run_processor(self, node): for child in node: - # if child.tag == "table": - # child.set("class", "markdown-body") + if child.tag == "table": + child.set("class", "markdown-table") + if child.tag == "th" or child.tag == "td": + child.set("class", "markdown-table-cell") if child.tag == "img": child.set("class", "img-fluid") self.run_processor(child) diff --git a/vue3/src/components/display/Instructions.vue b/vue3/src/components/display/Instructions.vue index d22d6131b..6ff9254cc 100644 --- a/vue3/src/components/display/Instructions.vue +++ b/vue3/src/components/display/Instructions.vue @@ -52,4 +52,38 @@ p, ol, ul, li { margin: revert; } + +/* css classes needed to render markdown blockquotes */ +blockquote { + background: rgb(200,200,200,0.2); + border-left: 4px solid #ccc; + margin: 1.5em 10px; + padding: .5em 10px; + quotes: none; +} + +blockquote:before { + color: #ccc; + content: open-quote; + font-size: 4em; + line-height: .1em; + margin-right: .25em; + vertical-align: -.4em; +} + +blockquote p { + display: inline; +} + +.markdown-table { + border: 1px solid; + border-collapse: collapse; +} + +.markdown-table-cell { + border: 1px solid; + border-collapse: collapse; + padding: 8px; +} + diff --git a/vue3/src/components/inputs/StepMarkdownEditor.vue b/vue3/src/components/inputs/StepMarkdownEditor.vue index 6eaadf0d5..255b1ea15 100644 --- a/vue3/src/components/inputs/StepMarkdownEditor.vue +++ b/vue3/src/components/inputs/StepMarkdownEditor.vue @@ -1,5 +1,5 @@