|
264 | 264 | color: #374151; |
265 | 265 | text-align: left; |
266 | 266 | } |
| 267 | + .control-text div { |
| 268 | + line-height: 1.6; |
| 269 | + margin-bottom: 0.25em; |
| 270 | + } |
267 | 271 | .control-discussion { |
268 | 272 | background: #f9fafb; |
269 | 273 | padding: 1rem; |
|
571 | 575 | color: #4b5563; |
572 | 576 | margin-bottom: 1rem; |
573 | 577 | } |
| 578 | + .modal-control-text div { |
| 579 | + line-height: 1.6; |
| 580 | + margin-bottom: 0.25em; |
| 581 | + } |
574 | 582 | .modal-overlays { |
575 | 583 | margin-bottom: 1rem; |
576 | 584 | } |
@@ -869,6 +877,35 @@ <h2 class="toggles-title">Additional Security Assumptions</h2> |
869 | 877 | attachSearchListeners(); |
870 | 878 | } |
871 | 879 |
|
| 880 | + // -------------------- |
| 881 | + // Helper Functions |
| 882 | + // -------------------- |
| 883 | + function formatControlText(text) { |
| 884 | + if (!text) return ''; |
| 885 | + |
| 886 | + // Split by newlines and process each line |
| 887 | + const lines = text.split('\n'); |
| 888 | + const formattedLines = lines.map(line => { |
| 889 | + // Check for different indentation patterns |
| 890 | + if (line.match(/^\([a-z]\)/)) { |
| 891 | + // Lines starting with (a), (b), etc. - deepest level |
| 892 | + return `<div style="margin-left: 3em;">${line}</div>`; |
| 893 | + } else if (line.match(/^\d+\./)) { |
| 894 | + // Lines starting with 1., 2., etc. - middle level |
| 895 | + return `<div style="margin-left: 1.5em;">${line}</div>`; |
| 896 | + } else if (line.match(/^[a-z]\./)) { |
| 897 | + // Lines starting with a., b., etc. - top level |
| 898 | + return `<div style="margin-top: 0.5em;">${line}</div>`; |
| 899 | + } else if (line.trim() !== '') { |
| 900 | + // Other non-empty lines (continuation of previous line) |
| 901 | + return `<div style="margin-left: 1.5em;">${line}</div>`; |
| 902 | + } |
| 903 | + return ''; |
| 904 | + }); |
| 905 | + |
| 906 | + return formattedLines.join(''); |
| 907 | + } |
| 908 | + |
872 | 909 | // -------------------- |
873 | 910 | // Main Render Function |
874 | 911 | // -------------------- |
@@ -957,7 +994,7 @@ <h2 class="toggles-title">Additional Security Assumptions</h2> |
957 | 994 | </div> |
958 | 995 | </div> |
959 | 996 | <div class="control-details" id="details-${control.id}"> |
960 | | - <div class="control-text"><strong>Control Text:</strong><br>${control.text}</div> |
| 997 | + <div class="control-text"><strong>Control Text:</strong><br>${formatControlText(control.text)}</div> |
961 | 998 | ${control.discussion ? ` |
962 | 999 | <div class="control-discussion"> |
963 | 1000 | <div class="discussion-title">Discussion:</div> |
@@ -1120,7 +1157,7 @@ <h3 class="overlays-title">Overlays</h3> |
1120 | 1157 | <div class="modal-control-name">${targetControl.name}</div> |
1121 | 1158 | <div class="modal-control-text"> |
1122 | 1159 | <strong>Control Text:</strong><br> |
1123 | | - ${targetControl.text} |
| 1160 | + ${formatControlText(targetControl.text)} |
1124 | 1161 | </div> |
1125 | 1162 | ${overlays.length > 0 ? ` |
1126 | 1163 | <div class="modal-overlays"> |
@@ -1593,7 +1630,7 @@ <h3 class="overlays-title">Overlays</h3> |
1593 | 1630 | </div> |
1594 | 1631 | </div> |
1595 | 1632 | <div class="control-details" id="details-${enhancementId}"> |
1596 | | - <div class="control-text"><strong>Enhancement Text:</strong><br>${enhancement.text}</div> |
| 1633 | + <div class="control-text"><strong>Enhancement Text:</strong><br>${formatControlText(enhancement.text)}</div> |
1597 | 1634 | ${enhancement.discussion ? ` |
1598 | 1635 | <div class="control-discussion"> |
1599 | 1636 | <div class="discussion-title">Discussion:</div> |
|
0 commit comments