From e0fddf0ed9b1a97656d5494b8be2a19b5dddb94c Mon Sep 17 00:00:00 2001
From: Antoine CORDIER
Date: Tue, 27 Feb 2024 15:41:56 +0000
Subject: [PATCH] fix: render markdown in gv-promote description
see https://gravitee.atlassian.net/browse/APIM-3892
---
src/molecules/gv-promote/gv-promote.js | 11 ++++++++---
src/molecules/gv-promote/gv-promote.stories.js | 8 ++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/molecules/gv-promote/gv-promote.js b/src/molecules/gv-promote/gv-promote.js
index 567df09e..26296fac 100644
--- a/src/molecules/gv-promote/gv-promote.js
+++ b/src/molecules/gv-promote/gv-promote.js
@@ -141,6 +141,12 @@ export class GvPromote extends ItemResource(LitElement) {
text-align: justify;
}
+ .description *,
+ .description-large * {
+ display: contents;
+ font-size: var(--gv-theme-font-size-m, 14px);
+ }
+
.infos {
display: flex;
justify-content: flex-end;
@@ -187,14 +193,13 @@ export class GvPromote extends ItemResource(LitElement) {
? html`${owner}
`
: ''}
10,
})}
- >
- ${truncate(getDescription(this._item), this.limit)}
-
+ >
${this._renderMetricsWithRating()}
${this._renderLabels(true)}
Tempore quo primis
auspiciis in mundanum fulgorem surgeret victura dum erunt homines Roma, ' +
'ut augeretur sublimibus incrementis, foedere pacis aeternae Virtus convenit atque plerumque dissidentes,';
const longDescription =
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non viverra magna. ' +
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non viverra magna. ' +
'Duis justo risus, iaculis vel luctus vel, euismod quis ipsum. Sed pellentesque elit eu enim auctor ullamcorper. ' +
- 'Donec rhoncus, nunc eget tempus viverra, leo libero lobortis nibh, quis vulputate ligula nunc sit amet erat. ' +
+ 'Donec rhoncus, nunc eget tempus viverra, leo libero lobortis nibh,
quis vulputate ligula nunc sit amet erat. ' +
'Suspendisse mi mauris, convallis non lobortis id, elementum eu orci. Fusce mattis aliquam augue eu pharetra. ' +
'Morbi quam neque, interdum ut ullamcorper lacinia, viverra ut odio. Aliquam porttitor a augue ut dignissim. ' +
- 'Nulla facilisi. Praesent eget varius ante. Interdum et malesuada fames ac ante ipsum primis in faucibus.';
+ 'Nulla facilisi. Praesent eget varius ante. Interdum et malesuada fames ac ante ipsum primis in faucibus.
';
const ratingSummary = { average: 3.2, count: 345 };
const metrics = { hits: '11M+', subscribers: '689', health: '0.95' };