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

language_md: improvements consolidating #814 and #840 #862

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

jgmdev
Copy link
Member

@jgmdev jgmdev commented Mar 4, 2022

This pull basically is the consolidation of work from #814 and #840 with additional fixes and improvements:

  • Use italic font when * or _ is used
  • Use bold font when ** or __ is used
  • Use bold/italic font when *** or ___ is used
  • Added additional language identifiers like json, ini and cpp
  • Colorize links with different color for text and link it self.
  • Block quotes operator is colorized but not the text to allow colorization of other elements that could be allowed in them like * as specified here
  • added support for <link> or <email>
  • don't colorize text containing underscores eg: some_name_here as specified here
  • Added support for subscript/superscript
  • limit headings amount up to 6
  • added support for additional list formats like + and 1.
  • Added support for additional horizontal line formats: ___, ***
  • removed duplicated php section declaraction
  • Added block_comment = { "<!--", "-->" }

@jgmdev jgmdev merged commit 1fa1960 into lite-xl:master Mar 4, 2022
@Guldoman
Copy link
Member

Guldoman commented Mar 5, 2022

This PR is a bit problematic:

  • It shouldn't introduce new syntax types
  • A default language plugin shouldn't include code outside of what's strictly needed for highlighting
  • The scaling feature doesn't seem to work

I think that the additional functionalities should be moved to an external plugin.
Or, if we really want to provide an advanced markdown syntax highlighter, we should provide a way to specify directly in the syntax table additional token styles, without having to resort to hacks.

Something like:

{
  pattern = { "%s_[%S]", "_%f[%s]" },
  type = "keyword2",
  italic = true,
  bold = false,
  size = function (s) return s * 1.2 end,
-- or scale = 1.2,
},

Also, it would be great if PRs would stay up a few days before being merged to allow other contributors to pitch in with suggestions. At least for non trivial PRs.

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

Successfully merging this pull request may close these issues.

2 participants