Skip to content

Would like to embed diff-lcs such that it yields a html diff as a string #41

@bwl21

Description

@bwl21

I currently use

rawDiff     = Diffy::Diff.new(other.trace_orig, self.trace_orig)
diff_as_html=rawDiff.to_s(:html)

But diffy calls another executable. In our case we use ldiff as provided by liff-lcs.

I wanted to achieve something like

diff_as_html=diffs = Diff::LCS.htmldiff('foo', 'bfoobar')

which should yield

"<div class=\"diff\">\n  <ul>\n    <li class=\"del\"><del>foo</del></li>\n    <li class=\"ins\"><ins>foo<strong>bar</strong></ins></li>\n  </ul>\n</div>\n"

How can I achieve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions