Skip to content

Commit

Permalink
Fix extraneous space in content from the NKJV
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Sep 3, 2023
1 parent 041c849 commit df389a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/html/psa.23.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<span class="ChapterContent_q2_kT48m">
<span class="ChapterContent_verse_kT48m" data-usfm="PSA.23.1">
<span class="ChapterContent_content_kT48m"> </span>
<span class="ChapterContent_content_kT48m">consectetur adipiscing</span>
<span class="ChapterContent_it__p_cmC">
<span class="ChapterContent_content_kT48m">consectetur adipiscing</span>
</span>
<span class="ChapterContent_content_kT48m"> </span>
<span class="ChapterContent_note_kT48m">Nam ac ante mi.</span>
<span class="ChapterContent_content_kT48m">elit.</span>
Expand Down
5 changes: 3 additions & 2 deletions yvs/copy_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ def handle_starttag(self, tag, attrs):
elem_class = attrs.get('class')
if not elem_class:
return
is_in_verse = self.is_in_verse()
# Detect paragraph breaks between verses
if self.class_matches_oneof(elem_class, self.block_elems):
if self.class_matches_oneof(elem_class, self.block_elems) and not is_in_verse:
self.in_block = True
self.block_depth = self.depth
self.content_parts.append(
'\n\n' if self.include_line_breaks else ' ')
# Detect line breaks within a single verse
if self.class_matches_oneof(elem_class, self.break_elems):
if self.class_matches_oneof(elem_class, self.break_elems) and not is_in_verse:
self.content_parts.append(
'\n' if self.include_line_breaks else ' ')
# Detect beginning of a single verse (may include footnotes)
Expand Down

0 comments on commit df389a9

Please sign in to comment.