Sha256: f05c0c63397d24dc42c0d7b48f50277f87573423125ab78ce1a061a584c3d54b
Contents?: true
Size: 482 Bytes
Versions: 8
Compression:
Stored size: 482 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::BakeInjectedExercise def self.v1(exercise:) V1.new.bake(exercise: exercise) end class V1 def bake(exercise:) context = exercise.search('div[data-type="exercise-context"]')&.first return unless context # link replacement is done by BakeLinkPlaceholders link = context.first('a').cut context.replace_children(with: "#{I18n.t(:context_lead_text)}#{link.paste}") end end end
Version data entries
8 entries across 8 versions & 1 rubygems