618 def xml_markup( |
618 def xml_markup( |
619 range: Text.Range = Text.Range.full, |
619 range: Text.Range = Text.Range.full, |
620 elements: Markup.Elements = Markup.Elements.full): XML.Body = |
620 elements: Markup.Elements = Markup.Elements.full): XML.Body = |
621 state.xml_markup(version, node_name, range = range, elements = elements) |
621 state.xml_markup(version, node_name, range = range, elements = elements) |
622 |
622 |
623 def xml_markup_blobs(elements: Markup.Elements = Markup.Elements.full): List[XML.Body] = |
623 def xml_markup_blobs(elements: Markup.Elements = Markup.Elements.full) |
|
624 : List[(Path, XML.Body)] = |
624 { |
625 { |
625 snippet_command match { |
626 snippet_command match { |
626 case None => Nil |
627 case None => Nil |
627 case Some(command) => |
628 case Some(command) => |
628 for (Exn.Res(blob) <- command.blobs) |
629 for (Exn.Res(blob) <- command.blobs) |
629 yield { |
630 yield { |
630 val text = blob.read_file |
631 val bytes = blob.read_file |
631 val markup = command.init_markups(Command.Markup_Index.blob(blob)) |
632 val text = bytes.text |
632 markup.to_XML(Text.Range(0, text.length), text, elements) |
633 val xml = |
|
634 if (Bytes(text) == bytes) { |
|
635 val markup = command.init_markups(Command.Markup_Index.blob(blob)) |
|
636 markup.to_XML(Text.Range(0, text.length), text, elements) |
|
637 } |
|
638 else Nil |
|
639 blob.src_path -> xml |
633 } |
640 } |
634 } |
641 } |
635 } |
642 } |
636 |
643 |
637 |
644 |