SublimeText-Markdown / MarkdownEditing

Powerful Markdown package for Sublime Text with better syntax understanding and good color schemes.
MIT License
3.18k stars 648 forks source link

Add Highlight Syntax Highlighting to MarkdownEditing #764

Closed mmerline closed 1 month ago

mmerline commented 1 month ago

If possible, please add Highlight syntax to MarkdownEditing.

In apps like iA Writer, “You can use double equals signs to highlight text”. Two equal signs (==) before and after the words highlights the text in the app and is rendered as <mark>[highlighted text]</mark> when exported as HTML.

Screenshot of Highlighted Text in iA Writer

I recognize this is very similar to one aspect of the Critic Markup spec included in the Markdown Editing package, the {== highlight==}{>> comment <<} inline critic markup, but that markup renders as <span class="critic criticcomment inline" data-comment=" comment ">[Critic Markup highlight text]</span>. This would be complementary.

Thanks. Please let me know if you have any questions or if I missed some required information.

deathaxe commented 1 month ago

Note that's not a CommonMark nor Github flavoured markdown feature.

As long as no bold/italic or other content is to be supported within the highlighted region, implementation should however be rather simple.

deathaxe commented 1 month ago

Added by v3.1.14

mmerline commented 1 month ago

@deathaxe, thank you for implementing this. After updating the package it appears the standard MarkdownEditing themes aren't providing syntax highlighting for the added ==highlight== code. Something I need to change on my end?

Screenshot of ==highlight== Test

deathaxe commented 1 month ago

You can customize them via UI: Customize Color Scheme and add your own user-defined highlighting rules, though.

{
    "name": "Markup: Highlight",
    "scope": "markup.highlight",
    "foreground": "black",
    "background": "yellow"
},
mmerline commented 1 month ago

You can customize them via UI: Customize Color Scheme and add your own user-defined highlighting rules, though.

{
  "name": "Markup: Highlight",
  "scope": "markup.highlight",
  "foreground": "black",
  "background": "yellow"
},

Is this the correct way to add that code to the default template?

// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
    "variables":
    {

    },
    "globals":
    {
        "selection_corner_style": "square",
        "brackets_options": "foreground bold glow",
    },
    "rules":
    [
        {
        "name": "Markup: Highlight",
        "scope": "markup.highlight",
        "foreground": "black",
        "background": "yellow"
        }
    ]
}
deathaxe commented 1 month ago

Yeah.