diff --git a/app/assets/stylesheets/themes/default.css.sass b/app/assets/stylesheets/themes/default.css.sass index 6bd7a3b1..597c55ce 100644 --- a/app/assets/stylesheets/themes/default.css.sass +++ b/app/assets/stylesheets/themes/default.css.sass @@ -117,7 +117,7 @@ h1 weight: normal size: $font-size-headline -h2, h3, h6 +h3, h6 display: none /////////////////////////////// @@ -223,7 +223,7 @@ footer ul.notes +column(12) - li + li, li h2 font: family: $font-family-body size: $font-size-body @@ -231,8 +231,9 @@ ul.notes margin-bottom: $line-height display: block +column-break-inside(avoid) - a:first-line + h2 color: $title-color + display: inline .notes-show figure @@ -329,7 +330,6 @@ ul.notes +column(12) +columns(2) - /////////////////////////////// // // Media-queries diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9be7e972..2c9f3479 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,7 +20,7 @@ def dir_attr(language) end def snippet(text, characters, omission = '...') - text = ActionController::Base.helpers.strip_tags(text) + text = ActionController::Base.helpers.sanitize(text, :tags => ['h2']) text = text.gsub(/\[.+\]/, '') text = ActionController::Base.helpers.truncate(text, :length => characters, :separator => ' ', :omission => omission) end diff --git a/app/models/note.rb b/app/models/note.rb index 32fa7fcf..afedf3df 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -38,9 +38,9 @@ class Note < ActiveRecord::Base def blurb # If the title is derived from the body, we do not include it in the blurb if self.body.index(self.title.gsub(/\.\.\.$/, '')) == 0 - self.body + '

' + self.title + '

: ' + self.body.gsub(/"#{ self.title }"/, '') else - self.title + ': ' + self.body + '

' + self.title + '

: ' + self.body end end diff --git a/app/views/application/_notes_list.html.haml b/app/views/application/_notes_list.html.haml index 0f191ce5..0dbd2f82 100644 --- a/app/views/application/_notes_list.html.haml +++ b/app/views/application/_notes_list.html.haml @@ -5,5 +5,5 @@ - if image = link_to "#{ image_tag(cut_image_path(image), :alt => strip_tags(image.description), :width => Settings.styling.images.thumbnail.width) } #{ snippet(note.blurb, Settings.notes.blurb_length) }".html_safe, note, :lang => lang_attr(note.lang), :dir => dir_attr(note.lang) - else - = link_to snippet(note.blurb, Settings.notes.blurb_length), note, + = link_to snippet(note.blurb, Settings.notes.blurb_length).html_safe, note, :lang => lang_attr(note.lang), :dir => dir_attr(note.lang)