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

Add optional leading whitespace highlighting capability #2583

Closed
wants to merge 11 commits into from

Conversation

AgentHagu
Copy link

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Fixes #2573

Overview of changes:
Allows users to now optionally highlight leading whitespace, giving them more options when using MarkBind.

Users can now add an optional + after their highlight index specifier to indicate that the index should be inclusive of leading whitespace. For example previously 1[:4] would highlight the abcd in abcd. But now, by instead using 1[:4]+, MarkBind will highlight ab in abcd (i.e. it will highlight the first 2 whitespace in the string).

Anything you'd like to highlight/discuss:

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)
Add optional leading whitespace highlighting capability


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

AgentHagu and others added 11 commits December 19, 2024 16:23
dangerfile.js violates eslint rules at the moment, perhaps due to
something wrong with setup.
Update regex and parsing of HighlightRuleComponent to support
"+" symbol, which indicates highlighter index specifiers should
be inclusive of preceding whitespace of the line.
@AgentHagu AgentHagu closed this Jan 13, 2025
@AgentHagu AgentHagu changed the title Highlighter enhancement Add optional leading whitespace highlighting capability Jan 13, 2025
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.

Highlighting code blocks: leading spaces should be counted
1 participant