Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow prism-diff to be used for highlight #98

Open
vlsi opened this issue Jun 29, 2020 · 2 comments
Open

Allow prism-diff to be used for highlight #98

vlsi opened this issue Jun 29, 2020 · 2 comments

Comments

@vlsi
Copy link

vlsi commented Jun 29, 2020

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>
@pomber
Copy link
Owner

pomber commented Jun 29, 2020

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.

@vlsi
Copy link
Author

vlsi commented Jun 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants