FEATURE: Markdown support for product description (#21)

This commit is contained in:
Faizaan Gagan 2020-10-12 20:31:33 +05:30 committed by GitHub
parent 866e485c1c
commit 55e6accb9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ module DiscourseSubscriptions
{ {
id: product[:id], id: product[:id],
name: product[:name], name: product[:name],
description: product[:metadata][:description], description: PrettyText.cook(product[:metadata][:description]),
subscribed: current_user_products.include?(product[:id]) subscribed: current_user_products.include?(product[:id])
} }
end end

View File

@ -6,7 +6,7 @@
<h2>{{product.name}}</h2> <h2>{{product.name}}</h2>
<p class="product-description"> <p class="product-description">
{{product.description}} {{html-safe product.description}}
</p> </p>
{{#if isLoggedIn}} {{#if isLoggedIn}}

View File

@ -8,7 +8,7 @@
<hr> <hr>
<p> <p>
{{model.product.description}} {{html-safe model.product.description}}
</p> </p>
</div> </div>
<div class="section-column"> <div class="section-column">

View File

@ -32,7 +32,7 @@ module DiscourseSubscriptions
expect(response.parsed_body).to eq([{ expect(response.parsed_body).to eq([{
"id" => "prodct_23456", "id" => "prodct_23456",
"name" => "Very Special Product", "name" => "Very Special Product",
"description" => "Many people listened to my phone call with the Ukrainian President while it was being made", "description" => PrettyText.cook("Many people listened to my phone call with the Ukrainian President while it was being made"),
"subscribed" => false "subscribed" => false
}]) }])
end end
@ -54,7 +54,7 @@ module DiscourseSubscriptions
expect(response.parsed_body).to eq([{ expect(response.parsed_body).to eq([{
"id" => "prodct_23456", "id" => "prodct_23456",
"name" => "Very Special Product", "name" => "Very Special Product",
"description" => "Many people listened to my phone call with the Ukrainian President while it was being made", "description" => PrettyText.cook("Many people listened to my phone call with the Ukrainian President while it was being made"),
"subscribed" => false "subscribed" => false
}]) }])
end end
@ -86,7 +86,7 @@ module DiscourseSubscriptions
expect(response.parsed_body).to eq( expect(response.parsed_body).to eq(
"id" => "prodct_23456", "id" => "prodct_23456",
"name" => "Very Special Product", "name" => "Very Special Product",
"description" => "Many people listened to my phone call with the Ukrainian President while it was being made", "description" => PrettyText.cook("Many people listened to my phone call with the Ukrainian President while it was being made"),
"subscribed" => false "subscribed" => false
) )
end end