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

fix(main): show italic in markdown #482

Closed
wants to merge 1 commit into from
Closed

fix(main): show italic in markdown #482

wants to merge 1 commit into from

Conversation

nshern
Copy link

@nshern nshern commented Jan 22, 2024

show italic is markdown by changing @markup.emphais to @markup.italic for all theme variants

Fixes #481

show italic is markdown by changing @markup.emphais to @markup.italic for all theme variants
@TheShonuff
Copy link

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

@nshern
Copy link
Author

nshern commented Jan 25, 2024

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

Hi, you can simply fix it through the config. This is my config:

return {
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "tokyonight",
    },
  },
  {
    "folke/tokyonight.nvim",
    config = function()
      require("tokyonight").setup({
        style = "night",
        transparent = true,
        styles = { sidebars = "transparent", floats = "transparent" },
        on_highlights = function(hl)
          hl["@markup.italic.markdown_inline"] = { style = "italic" }
        end,
      })
    end,
  },
}

@TheShonuff
Copy link

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

Hi, you can simply fix it through the config. This is my config:

return {
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "tokyonight",
    },
  },
  {
    "folke/tokyonight.nvim",
    config = function()
      require("tokyonight").setup({
        style = "night",
        transparent = true,
        styles = { sidebars = "transparent", floats = "transparent" },
        on_highlights = function(hl)
          hl["@markup.italic.markdown_inline"] = { style = "italic" }
        end,
      })
    end,
  },
}

Ah thank you! I was goofing it up by doing h1.["@markup.italic.markdown_inline"]

@adrian5
Copy link
Contributor

adrian5 commented Feb 3, 2024

Yeah, I reckon the recent nvim-treesitter overhaul broke this, as it used to work before. Would be good to see this merged, though I'm not sure doing the formatting tweaks in the same commit is a good idea. Might be why it hasn't been merged yet.

@adrian5
Copy link
Contributor

adrian5 commented Mar 15, 2024

@folke Any chance to get his merged, at least the relevant change to theme.lua? If not, can you at least give some feedback?

The tree-sitter capture group indeed looks to be @markup.italic and that should fix the regression.

@nshern nshern closed this by deleting the head repository May 18, 2024
@folke
Copy link
Owner

folke commented May 19, 2024

italics work in tokyonoght

@adrian5
Copy link
Contributor

adrian5 commented May 19, 2024

italics work in tokyonoght

Did you even bother to look at the above PR? I even made second one to simplify review. This issue has been pointed out months ago and the theme still sets the deprecated @markup.emphasis group. It never worked in nvim-0.9 without user overrides:

markdown

The just-released nvim-0.10 handles it, but doesn't render the change in this PR obsolete.

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

Successfully merging this pull request may close these issues.

bug: using italic in markdown does not make text italic
4 participants