Carbon: Way to indicate invalid code

Created on 19 May 2020  ·  5Comments  ·  Source: carbon-app/carbon

I love using carbon when I need to include code samples in my slides. I'm often talking about incorrect code, though, and how to fix it- so I'd love a way to indicate that a line of code should be marked incorrect.

By adding a toggle that applied something similar to the following CSS, to a line of code, it could perhaps visually imitate other IDEs:

text-decoration: red wavy underline;
text-decoration-skip-ink: none;

Here's an image:
carbon (10)

Thank you for considering!

enhancement

Most helpful comment

This is a fantastic idea! I was so excited about it tonight, I implemented the initial version (here https://github.com/carbon-app/carbon/pull/1015)

Once released, if you select some text, and click the _"U"_ twice, the text will get underlined as errant, as shown here:
Kapture 2020-05-19 at 21 04 31

It's not perfect (squiggles between spans sometimes render a gap), so we don't have to mark this issue closed quite yet, but I wanted to unblock your use case at least a little bit 🙂

All 5 comments

This is a fantastic idea! I was so excited about it tonight, I implemented the initial version (here https://github.com/carbon-app/carbon/pull/1015)

Once released, if you select some text, and click the _"U"_ twice, the text will get underlined as errant, as shown here:
Kapture 2020-05-19 at 21 04 31

It's not perfect (squiggles between spans sometimes render a gap), so we don't have to mark this issue closed quite yet, but I wanted to unblock your use case at least a little bit 🙂

@all-contributors add @MelSumner for ideas

@mfix22

I've put up a pull request to add @MelSumner! :tada:

Oh this is amazing, thank you so much!! 💯

Gonna close this as complete! Feel free to open a new issue if enhancements are desired.

Was this page helpful?
0 / 5 - 0 ratings