From bb82d64a0817bdef74ca91b69addc4d15de49617 Mon Sep 17 00:00:00 2001 From: ChristophWalter Date: Tue, 24 Mar 2020 09:09:50 +0100 Subject: [PATCH] Adapt code style as suggested by codeclimate --- src/formatter/html_div_formatter.js | 7 ++++++- src/parser/chord_pro_parser.js | 13 ++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/formatter/html_div_formatter.js b/src/formatter/html_div_formatter.js index ca0bda72..e3db0068 100644 --- a/src/formatter/html_div_formatter.js +++ b/src/formatter/html_div_formatter.js @@ -20,7 +20,12 @@ const template = hbs`
{{~#each items as |item|~}} {{~#if (isChordLyricsPair item)~}} -
{{chords}}
{{~#if (hasTextContents line)~}}
{{lyrics}}
{{~/if~}}
+
+
{{chords}}
+ {{~#if (hasTextContents line)~}} +
{{lyrics}}
+ {{~/if~}} +
{{~/if~}} {{~#if (isTag item)~}} diff --git a/src/parser/chord_pro_parser.js b/src/parser/chord_pro_parser.js index 27c19a9d..8b93d121 100644 --- a/src/parser/chord_pro_parser.js +++ b/src/parser/chord_pro_parser.js @@ -1,6 +1,5 @@ import Song from '../chord_sheet/song'; -import { END_OF_CHORUS, END_OF_VERSE, START_OF_CHORUS, START_OF_VERSE } from '../chord_sheet/tag'; -import { CHORUS, NONE, VERSE } from '../constants'; +import { NONE } from '../constants'; import ParserWarning from './parser_warning'; const NEW_LINE = '\n'; @@ -111,11 +110,11 @@ class ChordProParser { } applyTag(tag) { - if(tag.name.startsWith('start_of_')){ - const sectionName = tag.name.replace('start_of_', '') - this.startSection(sectionName,tag); - } else if(tag.name.startsWith('end_of_')){ - const sectionName = tag.name.replace('end_of_', '') + if (tag.name.startsWith('start_of_')) { + const sectionName = tag.name.replace('start_of_', ''); + this.startSection(sectionName, tag); + } else if (tag.name.startsWith('end_of_')) { + const sectionName = tag.name.replace('end_of_', ''); this.endSection(sectionName, tag); } }