notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

Yaml syntax highlighting does not respect empty lines in blocks of text

Open
#9,038 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lexilla dependent scintilla dependent
Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description of the Issue

Yaml syntax highlighting does not respect empty lines in blocks of text. An empty line is not considered to have lower indentation than the previous line, text blocks will continue across them.

Steps to Reproduce the Issue

Write yaml like this:

my_yaml_block: |
  This block is text

  even if the line above is empty
  these two lines below should also be highlighted as text. 

with row 2 empty

Expected Behavior

All lines above are highlighted as text

Actual Behavior

Rows 3 and 4 will be default-highlighted

Debug Information

Notepad++ v7.8.9 (64-bit)
Build time : Jul 15 2020 - 20:31:49
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1457
Current ANSI codepage : 1252
Plugins : GitSCM.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConverter.dll NppExport.dll NPPJSONViewer.dll NppXmlTreeviewPlugin.dll XMLTools.dll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the YAML example in Notepad++ and trace the YAML syntax-highlighting implementation to how empty lines inside literal blocks are handled. Done means the blank line and following indented lines are highlighted as text, matching the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.