jykoh commited on
Commit
8041bf9
1 Parent(s): c3cbbd8

Fix truncation

Browse files
Files changed (1) hide show
  1. fromage/utils.py +1 -1
fromage/utils.py CHANGED
@@ -32,7 +32,7 @@ def get_image_from_url(url: str):
32
 
33
  def truncate_caption(caption: str) -> str:
34
  """Truncate captions at periods and newlines."""
35
- caption = caption.strip()
36
  trunc_index = caption.find('\n') + 1
37
  if trunc_index <= 0:
38
  trunc_index = caption.find('.') + 1
 
32
 
33
  def truncate_caption(caption: str) -> str:
34
  """Truncate captions at periods and newlines."""
35
+ caption = caption.strip('\n')
36
  trunc_index = caption.find('\n') + 1
37
  if trunc_index <= 0:
38
  trunc_index = caption.find('.') + 1