Skip to content

Commit

Permalink
Merge pull request #962 from Terrastories/allow-some-html-tags
Browse files Browse the repository at this point in the history
Allow some basic HTML tags in story description
  • Loading branch information
julinvictus committed Nov 7, 2023
2 parents 718bc49 + 72c8854 commit 8db60fa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rails/app/javascript/components/Story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Story = props => {
{story.title}
{story.permission_level === "restricted" && " 🔒"}
</h6>
<p className="description">{story.desc}</p>
<p className="description" dangerouslySetInnerHTML={{ __html: story.desc }}></p>
{
story.media &&
story.media.map(file => (
Expand Down
2 changes: 1 addition & 1 deletion rails/app/views/dashboard/stories/_stories.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<span class="badge badge-green"><%= Story.human_attribute_name("permission_level.#{story.permission_level}") %></span>
<% end %>

<p><%= story.desc %></p>
<p><%= sanitize story.desc, tags: %w(strong em u) %></p>
</div>

<div>
Expand Down
2 changes: 1 addition & 1 deletion rails/app/views/dashboard/stories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</div>

<div class="two-columns-left">
<p class="render-lines"><%= @story.desc %></p>
<p class="render-lines"><%= sanitize @story.desc, tags: %w(strong em u) %></p>

<% @story.media.each do |media| %>
<p class="media">
Expand Down

0 comments on commit 8db60fa

Please sign in to comment.