diff --git a/web/main.js b/web/main.js
index 9850555..2022074 100644
--- a/web/main.js
+++ b/web/main.js
@@ -389,36 +389,45 @@ var md = null;
function getSrs(item, id ='srs') {
const cid = `${id}-${item.id}`;
let r = '';
- if (Object.keys(item.srs).length) {
- r = '' +
- '
' +
- ' ' +
- Object.keys(item.srs).map(function(v) {
- const tid = `${cid}-${v}`;
- topics[tid] = item.srs[v];
- return `- ${v}
`;
- }).join('') +
- '
' +
- ''
- ;
- }
- if (item.components.length) {
+ const srsKeys = Object.keys(item.srs);
+ if (srsKeys.length || item.components.length) {
+ r += '' +
+ '' +
+ ` ` +
+ ` `
+ ;
+ if (srsKeys.length) {
+ r += '' +
+ '- ' +
+ '
' +
+ srsKeys.map(function(v) {
+ const tid = `${cid}-${v}`;
+ topics[tid] = item.srs[v];
+ return `- ${v}
`;
+ }).join('') +
+ '
' +
+ ' '
+ ;
+ }
+ if (item.components.length) {
+ r += '' +
+ item.components.map(function(v) {
+ return getSrs(v, cid);
+ }).join('')
+ ;
+ }
r += '' +
- '- ' +
- `` +
- `
` +
- item.components.map(function(v) {
- return getSrs(v, cid);
- }) +
- '
' +
- ' '
+ '
' +
+ ''
;
}
return r;
}
function initSrs() {
- md = window.markdownit();
+ md = window.markdownit({
+ breaks: true,
+ });
$.getJSON("srs", function(res, status){
if (res.success) {
srs = res.data.srs;