Skip to content

Commit

Permalink
Adapt code style as suggested by codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophWalter committed Mar 24, 2020
1 parent 48e75fe commit bb82d64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/formatter/html_div_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const template = hbs`
<div class="{{lineClasses line}}">
{{~#each items as |item|~}}
{{~#if (isChordLyricsPair item)~}}
<div class="column"><div class="chord">{{chords}}</div>{{~#if (hasTextContents line)~}}<div class="lyrics">{{lyrics}}</div>{{~/if~}}</div>
<div class="column">
<div class="chord">{{chords}}</div>
{{~#if (hasTextContents line)~}}
<div class="lyrics">{{lyrics}}</div>
{{~/if~}}
</div>
{{~/if~}}
{{~#if (isTag item)~}}
Expand Down
13 changes: 6 additions & 7 deletions src/parser/chord_pro_parser.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit bb82d64

Please sign in to comment.