What is your opinion on hashnode dev blog's code syntax highlighting?

Asad Awadia's photo

Definitely room for improvement

Francisco Quintero's photo

Well it looks:

f = Form.find_by(uuid: '4279a49c-d2fa-47dd-9fda-4e6a74216703')

puts "Count of questions: #{f.form_type.questions.count}"
puts "Count of answers: #{f.answers.count}"

answered_qs = f.answers.pluck(:question_id)
form_qs = f.question_ids

puts "Question IDs: #{form_qs}"
puts "Answered questions ids: #{answered_qs}"

answerable = form_qs - answered_qs

answerable.each do |id|
  q = Question.find(id)
  a = Answer.new(form: f, question: q, content: q.content)
  a.save(validate: false)
end

good?

Show +1 replies
Francisco Quintero's photo

Software Engineer & Ruby on Rails Developer

Faith Gaiciumia

You have to use three backticks (`). See markdownguide.org/extended-syntax/#fenced-c..

And if after the first three backticks you put the name of the programming language, the markdown parser can add nice colors to the code. As mentioned here markdownguide.org/extended-syntax/#syntax-h..

Jethro Lorenzo Garcia Lising's photo

Francisco Quintero

It doesn’t seem to work for dart.

void main() {
  print(“test”);
}