Skip to content

Ensure that highlighted lines do not have empty lines between them#63

Merged
mworrell merged 2 commits intomasterfrom
highlight-line-block
Mar 20, 2026
Merged

Ensure that highlighted lines do not have empty lines between them#63
mworrell merged 2 commits intomasterfrom
highlight-line-block

Conversation

@mworrell
Copy link
Copy Markdown
Member

@mworrell mworrell commented Mar 19, 2026

This pull request makes several improvements to the template highlighting and debug point rendering in template_compiler_highlight.erl, as well as updates to the related test suite. The main focus is on improving the structure and accessibility of debug checkboxes, as well as refining the line styling for highlighted templates.

Rendering and accessibility improvements:

  • The debug checkbox label now includes both an aria-label and a title attribute for better accessibility, and the aria-label no longer redundantly includes the filename.
  • The order of HTML attributes and elements in the debug checkbox label is adjusted for improved accessibility and clarity.

Styling adjustments:

  • The STYLE_LINE CSS is changed from display:block to display:inline-block to improve the layout of highlighted lines.

Test enhancements:

  • The test highlight_module_test now asserts the order of rendered HTML elements to ensure the debug checkbox and its label appear before the highlighted span, improving test coverage for rendering correctness.

Copilot AI review requested due to automatic review settings March 19, 2026 11:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the template syntax-highlighting HTML output to avoid rendering extra blank lines between highlighted source lines, particularly in <pre><code> output where line wrappers and explicit \n separators interact.

Changes:

  • Adjust line-wrapper styling for highlighted lines from display:block to display:inline-block.
  • Extend highlight_module_test/1 with an assert_in_order/2 check around debug checkbox output and the highlighted identifier.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/template_compiler_highlight.erl Tweaks inline CSS for per-line wrapper spans to prevent visual double-spacing between lines.
test/template_compiler_highlight_SUITE.erl Adds an ordering assertion in the module-highlighting test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mworrell mworrell self-assigned this Mar 19, 2026
@mworrell mworrell merged commit 1cb5649 into master Mar 20, 2026
3 checks passed
@mworrell mworrell deleted the highlight-line-block branch March 20, 2026 08:20
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.

2 participants