Skip to content

Support diff highlighting in Markdown code blocks #1582

@Daeraxa

Description

@Daeraxa

Have you checked for existing feature requests?

  • Completed

Summary

Pulsar should be able to handle simple diff syntax within Markdown code blocks. e.g.

- line 1
- line 2
+ new line 1 
+ new line 2

Currently it highlights them just as a default gfm text scope:

Image

For reference this is how it looks in Helix:

Image

This is at least supported in markdown-preview (at least with the default Linguist highlighter):

Image

I appreciate that (I think?) we don't support diff highlighting out of the box? (The language-git package suggests installing https://web.pulsar-edit.dev/packages/language-diff) but installing that doesn't seem inject it into the GFM grammar either.

Kind of related but maybe we should integrate diff support directly into language-git by default?

What benefits does this feature provide?

Diff highlighting in markdown code blocks

Any alternatives?

Not that I could find

Other examples:

Helix. Very likely in VSCode too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions