' + convertcode(mds[m].substr(2)) +
+ else if (cr == 'r')
+ html += '' + convertcode(mds[m].substring(2)) +
'
';
+ else if (cr == '1')
+ html += '' + olnum(0, titnum, '、') + convertcode(mds[m].substring(2)) + '
';
else
- html += '' + convertcode(mds[m].substr(1)) + '
';
+ html += '' + convertcode(mds[m].substring(1)) + '
';
} else if (mds[m][0] == '@') { //c居中,r靠右
- if (mds[m][1] == 'c' || mds[m][1] == 'C')
- html += '
' + convertcode(mds[m].substr(2)) +
- '
';
- else if (mds[m][1] == 'r' || mds[m][1] == 'R')
- html += '' + convertcode(
- mds[m].substr(2)) + '
';
- else
- html += '' + mds[m].substr(1) + '
';
+ var cr = mds[m].substring(1, 2).toLowerCase();
+ if (cr == 'c')
+ html += '' + convertcode(mds[m].substring(2)) + '
';
+ else if (cr == 'r')
+ html += '' + convertcode(mds[m].substring(2)) + '
';
+ else if (mds[m][1] == '1') {
+ if (!isol) {
+ isol = true;
+ html += '';
+ }
+ html += '- ' + convertcode(mds[m].substring(2)) + '
';
+ } else
+ html += '' + mds[m].substring(1) + '
';
} else if (mds[m][0] == '!') { //图片、视频、音频
var mis = mds[m].split('|');
@@ -103,63 +124,102 @@
} else
match = url.match(/\.([^./]+)$/);
var exurl = match ? match[1] : '';
- htmls.push({type:'text',content:html});
+ htmls.push({
+ type: 'text',
+ content: html
+ });
html = '';
if (exurl == 'mp4' || exurl == 'm3u8') {
var alt = '';
if (mis[1])
alt = ' alt="' + mis[1].replace('"', "") + '"';
- htmls.push({type:'video',content:url});
+ htmls.push({
+ type: 'video',
+ content: url
+ });
} else if (exurl == 'mp3') {
var alt = '';
if (mis[1])
alt = ' alt="' + mis[1].replace('"', "") + '"';
- htmls.push({type:'audio',content:url});
+ htmls.push({
+ type: 'audio',
+ content: url
+ });
} else {
var alt = '';
if (mis[1])
alt = ' alt="' + mis[1].replace('"', "") + '"';
- htmls.push({type:'image',content:url});
+ htmls.push({
+ type: 'image',
+ content: url
+ });
}
} else if (mds[m][0] == '<') { //原始HTML
html += mds[m];
} else {
+ if (isol) {
+ isol = false;
+ html += '
';
+ }
html += '' + convertcode(mds[m]) + '
';
}
}
- if(html)
- htmls.push({type:'text',content:html});
+ if (html) {
+ if (isol) {
+ isol = false;
+ html += '';
+ }
+ htmls.push({
+ type: 'text',
+ content: html
+ });
+ }
return htmls;
+ function olnum(idx, olnum, end) {
+ olnum[idx]++;
+ for (var i = idx + 1; i < olnum.length; i++)
+ olnum[i] = 0;
+ for (var i = 0; i <= idx; i++) {
+ if (olnum[i] == 0)
+ continue;
+ var ols = [];
+ for (var j = i; j <= idx; j++) {
+ ols.push(olnum[j]);
+ }
+ return ols.join('.') + end;
+ }
+ }
+
function convertcode(md) {
var bcode = false;
- md = md.replace(/ /g, ' ').replace(/ /g, ' ');
+ md = md.replace(/ /g, ' ');
while (true) {
var ind = md.indexOf('`');
if (ind == -1)
break;
- var el = '';
+ var el = '';
if (bcode) {
bcode = false;
- el = '';
+ el = '';
} else
bcode = true;
- md = md.substr(0, ind) + el + md.substr(ind + 1);
+ md = md.substring(0, ind) + el + md.substring(ind + 1);
}
while (true) {
var ind = md.indexOf('**');
if (ind == -1)
break;
- var el = '';
+ var el = '';
if (bcode) {
bcode = false;
- el = '';
+ el = '';
} else
bcode = true;
- md = md.substr(0, ind) + el + md.substr(ind + 2);
+ md = md.substring(0, ind) + el + md.substring(ind + 2);
}
if (bcode)
- md += '';
+ md += '';
return md;
}
}
diff --git a/fapp/ciyon_ap/components/ciy-popmenu/ciy-popmenu.vue b/fapp/ciyon_ap/components/ciy-popmenu/ciy-popmenu.vue
index c3de1fd..42302da 100644
--- a/fapp/ciyon_ap/components/ciy-popmenu/ciy-popmenu.vue
+++ b/fapp/ciyon_ap/components/ciy-popmenu/ciy-popmenu.vue
@@ -9,7 +9,7 @@
- {{lang(item.name)}}
+ {{lang(item.name)}}