Skip to content

Viewports for markdown violate markdown lint MD022 #298

@NGenetzky

Description

@NGenetzky

MD022 - Headings should be surrounded by blank lines

Since the regexp for VIEWPORT['markdown'] requires "Header beginning" (Note, this is also a typo).

VIEWPORT = {
    'default':
    re.compile(
        r'^'                         # Starts at the begging of the line
        r'[=]+'                      # Heading begging
        r'(?P<name>[^=\|\[\{]*)'     # Name of the viewport, all before the | sign
                                     # Cannot include '[', '=', '|', and '{'
        r'\|'                        # Bar
        r'(?!\|)'                    # (But not two, that would be a preset)
        r'(?P<filter>[^=\|]*?)'      # Filter
        r'('                         # Optional defaults
          r'\|'                      # Bar
          r'(?P<defaults>[^=\|]+?)'  # Default attrs
        r')?'
        r'\s*'                       # Any whitespace
        r'(#(?P<source>[A-Z]))?'     # Optional source indicator
        r'\s*'                       # Any whitespace
        r'(\$(?P<sort>[A-Z]))?'      # Optional sort indicator
        r'\s*'                       # Any whitespace
        r'[=]+'                      # Header ending
    ),
    'markdown':
    re.compile(
        r'^'                         # Starts at the begging of the line
        r'[#]+'                      # Heading begging
        r'(?P<name>[^#\|\[\{]*)'     # Name of the viewport, all before the | sign
                                     # Cannot include '[', '#', '|', and '{'
        r'\|'                        # Bar
        r'(?!\|)'                    # (But not two, that would be a preset)
        r'(?P<filter>[^#\|]*?)'      # Filter
        r'('                         # Optional defaults
          r'\|'                      # Bar
          r'(?P<defaults>[^#\|]+?)'  # Default attrs
        r')?'
        r'\s*'                       # Any whitespace
        r'(#(?P<source>[A-Z]))?'     # Optional source indicator
        r'\s*'                       # Any whitespace
        r'(\$(?P<sort>[A-Z]))?'      # Optional sort indicator
        r'\s*'                       # Any whitespace
        r'$'                         # End of line
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions