Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7103173 commit 0c7c3dcCopy full SHA for 0c7c3dc
app/controllers/podcasts_controller.rb
@@ -23,7 +23,22 @@ def show
23
24
@title = @episode.title.split('-').last.strip
25
@date = @episode.published_date.strftime("%Y年%-m月%-d日(#{Podcast::WDAY2JAPANESE[@episode.published_date.wday]})")
26
- @content = Kramdown::Document.new(@episode.content, input: 'GFM').to_html
+ @content = Kramdown::Document.new(
27
+ self.convert_shownote(@episode.content),
28
+ input: 'GFM').to_html
29
@url = request.url
30
end
31
+
32
+ private
33
34
+ def convert_shownote(content)
35
+ shownote = <<~HTML
36
+ <h2 id='shownote'>
37
+ <a href='#shownote'><i class="fa-solid fa-message-pen" style='color: #2275ca;'></i></a>
38
+ Shownote − 話したこと
39
+ </h2>
40
+ HTML
41
42
+ content.gsub(/(#+) Shownote/i, shownote)
43
+ end
44
0 commit comments