From dc37808f4ff0e78b86994aa20ac3563b322e4b23 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sat, 1 Jul 2023 14:27:55 +0200 Subject: [PATCH] Partial fix for chord-only paragraphs --- chordpro-web.js | 5 +++-- chordpro.css | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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; -- 2.39.2