2019-05-30 14:35:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ProtocolImporters
|
|
|
|
class StepDescriptionBuilder
|
|
|
|
def self.generate(step_json)
|
|
|
|
return '' unless step_json[:description]
|
|
|
|
|
2019-06-18 23:47:08 +08:00
|
|
|
step_json[:description][:body] = TablesBuilder.remove_tables_from_html(step_json[:description][:body])
|
2019-06-03 18:42:15 +08:00
|
|
|
html_string = ApplicationController
|
|
|
|
.renderer
|
|
|
|
.render(template: 'protocol_importers/templates/step_description',
|
|
|
|
layout: false,
|
|
|
|
assigns: { step_description: step_json[:description] })
|
|
|
|
html_string
|
2019-05-30 14:35:16 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|