Skip to content

Allow prism-diff to be used for highlightΒ #98

@vlsi

Description

@vlsi

So far Code Surfer uses diff to add steps that advance steps (e.g. change focus). However, it would be nice to show the highlighted diff itself.

The workaround seems to be

import 'prismjs/components/prism-diff';
Prism.languages.diff2 = Prism.languages.diff;

...

<CodeSurfer>

```diff2
val helloWorld = "Hello world"
val world = "world"

@Benchmark
fun junit4() {
-    Assert.assertTrue(
-        "$helloWorld should contain $world",
-        helloWorld.contains(world)
-    )
+    Assertions.assertTrue(helloWorld.contains(world)) {
+        "$helloWorld should contain $world"
+    }
}
```

</CodeSurfer>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions