Lucas ARRIESSE commited on
Commit
f2a0397
·
1 Parent(s): 3075a31

Add md rendering

Browse files
Files changed (2) hide show
  1. index.html +3 -0
  2. static/script.js +13 -1
index.html CHANGED
@@ -5,6 +5,9 @@
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>Requirements Extractor</title>
 
 
 
8
  <link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
9
  <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
10
  </head>
 
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>Requirements Extractor</title>
8
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/16.0.0/lib/marked.umd.min.js"
9
+ integrity="sha512-ygzQGrI/8Bfkm9ToUkBEuSMrapUZcHUys05feZh4ScVrKCYEXJsCBYNeVWZ0ghpH+n3Sl7OYlRZ/1ko01pYUCQ=="
10
+ crossorigin="anonymous" referrerpolicy="no-referrer"></script>
11
  <link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
12
  <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
13
  </head>
static/script.js CHANGED
@@ -837,9 +837,21 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
837
  </svg>
838
  Solution Description
839
  </h4>
840
- <p class="text-xs text-gray-700 leading-relaxed">${solution['Solution Description'] || 'Aucune description de solution disponible.'}</p>
841
  `;
842
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843
  // Section Critique
844
  const critiqueSection = document.createElement('div');
845
  critiqueSection.className = 'bg-yellow-50 border-l-2 border-yellow-400 p-3 rounded-r-md';
 
837
  </svg>
838
  Solution Description
839
  </h4>
 
840
  `;
841
 
842
+ // container for markdown content
843
+ const solContents = document.createElement('div');
844
+ solContents.className = "text-xs text-gray-700 leading-relaxed";
845
+ solutionSection.appendChild(solContents);
846
+
847
+ try {
848
+ solContents.innerHTML = marked.parse(solution['Solution Description']);
849
+ }
850
+ catch (e) {
851
+ solContents.innerHTML = `<p class="text-xs text-gray-700 leading-relaxed">${solution['Solution Description'] || 'No available solution description'}</p>`;
852
+ }
853
+
854
+
855
  // Section Critique
856
  const critiqueSection = document.createElement('div');
857
  critiqueSection.className = 'bg-yellow-50 border-l-2 border-yellow-400 p-3 rounded-r-md';