Skip to content

Commit

Permalink
Merge 91bc022 into 3731984
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Feb 11, 2020
2 parents 3731984 + 91bc022 commit 02b1a2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/markdown_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class MarkdownController < ApplicationController
respond_to :js

def preview
markdown_source = params[:source].to_str.gsub(/:([\w+-]+):/) do |match|
markdown_source = params[:source].to_str.gsub(/(?<=^|\s):([\w+-]+):(?=\s|$)/) do |match|
%(![add-emoji](https://github.githubassets.com/images/icons/emoji/#{match.to_str.tr(':','')}.png))
end if params[:source]
@rendered = MarkdownHelper.render markdown_source
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def active_page_size(page_size, param=nil)
end

def emojify content
content.to_str.gsub(/:([\w+-]+):/) do |match|
content.to_str.gsub(/(?<=^|\s):([\w+-]+):(?=\s|$)/) do |match|
%(![add-emoji](https://github.githubassets.com/images/icons/emoji/#{match.to_str.tr(':','')}.png))
end.html_safe if content.present?
end
Expand Down

0 comments on commit 02b1a2a

Please sign in to comment.