2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-08 12:06:51 +08:00

FEATURE: refactoring and better handling of special cases (#6666)

This commit is contained in:
Joffrey JAFFEUX 2018-11-26 14:20:32 +01:00 committed by GitHub
parent 3453707784
commit b0d08b5a8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 605 additions and 295 deletions

View file

@ -1,9 +1,10 @@
require 'rails_helper'
def generate_html(text, opts = {})
output = "<p><span class=\"discourse-local-date\""
output = "<p><span"
output += " data-date=\"#{opts[:date]}\"" if opts[:date]
output += " data-time=\"#{opts[:time]}\"" if opts[:time]
output += " class=\"discourse-local-date\""
output += " data-format=\"#{opts[:format]}\"" if opts[:format]
output += " data-email-preview=\"#{opts[:email_preview]}\"" if opts[:email_preview]
output += ">"