]> piware.de Git - chordpro-web.git/commitdiff
Accept short directive names
authorMartin Pitt <martin@piware.de>
Wed, 23 Sep 2026 21:19:12 +0000 (23:19 +0200)
committerMartin Pitt <martin@piware.de>
Wed, 23 Sep 2026 21:19:19 +0000 (23:19 +0200)
Files in the wild use {t}, {st} and {c}; the latter made a song lose all
its section comments.

chordpro-web.js

index cb5ea81761aa35007f94d5ad5ea321be59c07728..5f5ba2f715ce9d67beec3285329a22715430a6be 100644 (file)
@@ -23,6 +23,10 @@ const directive_handlers = {
     },
     comment: value => html`<p class="comment">${value}</p>`,
 };
+// short forms
+directive_handlers.t = directive_handlers.title;
+directive_handlers.st = directive_handlers.subtitle;
+directive_handlers.c = directive_handlers.comment;
 
 function renderChordpro(text) {
     const song = [];