code-surfer icon indicating copy to clipboard operation
code-surfer copied to clipboard

Allow prism-diff to be used for highlight

Open vlsi opened this issue 4 years ago • 2 comments

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>

vlsi avatar Jun 29 '20 13:06 vlsi

Hey, thanks for all the feedback. I'm currently focusing on another project but will check your issues when I find some time for Code Surfer.

pomber avatar Jun 29 '20 19:06 pomber

Great. I was not sure if I should continue creating those :)

So far I'm able to pass through with workarounds, so there's no rush in fixing c-s.

vlsi avatar Jun 29 '20 20:06 vlsi