Class: Asciidoctor::PlantUml::BlockProcessor

Inherits:
Extensions::BlockProcessor
  • Object
show all
Defined in:
lib/asciidoctor-plantuml/plantuml.rb

Instance Method Summary collapse

Instance Method Details

#process(parent, target, attrs) ⇒ Object



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/asciidoctor-plantuml/plantuml.rb', line 258

def process(parent, target, attrs)

  lines = target.lines

  if !(target.lines[0] =~ /@startuml/)
    lines = ["@startuml"] + target.lines
  end

  if !(target.lines[-1] =~ /@enduml/)
    lines += ["@enduml"]
  end

  content = Processor.plantuml_content(lines.join("\n"), attrs)

  return create_plantuml_block(parent, content, attrs)

end