diff --git a/.ruby-version b/.ruby-version index a98d9a13..84d6c676 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-3.4.10 +3.4.10 diff --git a/Gemfile b/Gemfile index 0b02568e..39c804fd 100644 --- a/Gemfile +++ b/Gemfile @@ -105,3 +105,6 @@ gem 'sqids', '~> 0.2.2' gem 'acts_as_list' gem "commonmarker", "~> 2.9" + +#For auto linking +gem "rinku", require: "rails_rinku" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 9b93d98c..10b975b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -284,6 +284,7 @@ GEM reline (0.6.1) io-console (~> 0.5) rexml (3.4.1) + rinku (2.0.6) rubocop (1.78.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -410,6 +411,7 @@ DEPENDENCIES puma (>= 5.0) pundit (~> 2.5) rails (>= 8.0.2) + rinku rubocop rubocop-rails-omakase selenium-webdriver diff --git a/app/views/projects/_project_details.html.erb b/app/views/projects/_project_details.html.erb index 66fa4e67..8792e401 100644 --- a/app/views/projects/_project_details.html.erb +++ b/app/views/projects/_project_details.html.erb @@ -31,6 +31,10 @@ display_text = display_text.to_s.strip end + + #Re-sets display_text to use auto_link if it is not markdown(ie the long paragraph thing) since the markdown already includes implemented links + display_text = !is_markdown ? auto_link(sanitize(display_text), html: { class: "font-bold underline", target: "_blank", rel: "noopener" }) : display_text + rendered_markdown = is_markdown && display_text.present? ? render_markdown(display_text) : nil %> diff --git a/app/views/topics/_topic_field_list.html.erb b/app/views/topics/_topic_field_list.html.erb index fea4d2c3..10b2ffb3 100644 --- a/app/views/topics/_topic_field_list.html.erb +++ b/app/views/topics/_topic_field_list.html.erb @@ -31,6 +31,9 @@ display_text = display_text.to_s.strip end + #Re-sets display_text to use auto_link if it is not markdown(ie the long paragraph thing) since the markdown already includes implemented links + display_text = !is_markdown ? auto_link(sanitize(display_text), html: { class: "font-bold underline", target: "_blank", rel: "noopener" }) : display_text + rendered_markdown = is_markdown && display_text.present? ? render_markdown(display_text) : nil %> @@ -45,6 +48,7 @@ rounded-[4px] p-5 prose prose-sm max-w-none " > + <% if display_text.present? %><%= rendered_markdown %><% else %>No content provided<% end %> diff --git a/db/schema.rb b/db/schema.rb index 7afe4305..45c5a861 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,6 +11,9 @@ # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema[8.0].define(version: 2026_08_29_082339) do + # These are extensions that must be enabled in order to support this database + enable_extension "pg_catalog.plpgsql" + create_table "comments", force: :cascade do |t| t.integer "user_id", null: false t.string "text", null: false