Skip to content

Commit

Permalink
fix: better handling of examples with title / description that also h…
Browse files Browse the repository at this point in the history
…ave code blocks
  • Loading branch information
brian-mulier-p committed Jan 31, 2025
1 parent 3285aab commit 5944bfb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/plugins/PropertyDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
</div>

<div v-if="property.title !== undefined || property.description !== undefined">
<div class="property-description">
<div class="property-description markdown">
<slot v-if="property.title !== undefined" :content="codeSanitizer(property.title)" name="markdown" />
<slot v-if="property.description !== undefined" :content="codeSanitizer(property.description)" name="markdown" />
</div>
Expand Down
14 changes: 12 additions & 2 deletions src/components/plugins/SchemaToHtml.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</p>
</div>

<div v-if="schema.properties?.title" class="plugin-title">
<div v-if="schema.properties?.title" class="plugin-title markdown">
<slot name="markdown" :content="schema.properties.title" />
</div>
<div v-if="schema.properties?.description">
<div v-if="schema.properties?.description" class="markdown">
<slot name="markdown" :content="schema.properties.description" />
</div>

Expand Down Expand Up @@ -179,6 +179,16 @@
padding-bottom: 0.5rem !important;
}
:deep(.markdown pre) {
&:last-child {
margin-bottom: 0;
}
&:not(:first-child) {
margin-top: calc(var(--spacer) * .75);
}
}
:deep(.plugin-section) {
.material-design-icon {
&, & * {
Expand Down

1 comment on commit 5944bfb

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.