From: Martin Pitt Date: Sat, 1 Jul 2023 12:27:55 +0000 (+0200) Subject: Partial fix for chord-only paragraphs X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=dc37808f4ff0e78b86994aa20ac3563b322e4b23;hp=ce56d8478a3c3d175dd96250e752499cb41514b8;p=chordpro-web.git Partial fix for chord-only paragraphs --- 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') diff --git a/chordpro.css b/chordpro.css index 5b25d95..e2e75c4 100644 --- a/chordpro.css +++ b/chordpro.css @@ -19,6 +19,11 @@ h2 { line-height: 2.3em; } +.chord + .chord { + width: unset; + margin-left: 0.3ex; +} + .chord { position: relative; top: -1em;