X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=chordpro-web.js;h=45f800dc35ca9aeea9164957ff43bae7e159fa82;hb=dc37808f4ff0e78b86994aa20ac3563b322e4b23;hp=188646a6b65d9cbfc798a057875d487aceababa9;hpb=ce56d8478a3c3d175dd96250e752499cb41514b8;p=chordpro-web.git diff --git a/chordpro-web.js b/chordpro-web.js index 188646a..45f800d 100644 --- a/chordpro-web.js +++ b/chordpro-web.js @@ -44,8 +44,9 @@ function renderChordpro(text) { // split line into parts on chords const parts = []; - line.split(/(\[[^\]]+\])/).forEach(part => parts.push( - part[0] == '[' ? html`${part.slice(1, -1)}` : part + line.split(/(\[[^\]]+\])/).forEach(part => parts.push(part[0] == '[' + ? html`${part.slice(1, -1)}` + : (part ? html`${part}` : null) )); verseHasChords ||= parts.length > 1; parts.push('\n')