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

Column numbers identified by vale are incorrect for existence rule #791

Open
1 task done
sohailekline opened this issue Mar 12, 2024 · 1 comment
Open
1 task done

Comments

@sohailekline
Copy link

Check for existing issues

  • Completed

Environment

macOS
Direct Download
2.29.7

Describe the bug / provide steps to reproduce it

I have created a rule to ensure all the list items have ending punctuation at the end. Vale is able to run this rule but the output has some discrepancies.

Rule

extends: existence
message: "Must put the ending punctuation at the end of a list item."
link: ''
nonword: true
level: error
scope: list
tokens:
  - '[^.!?]\s*$'

Input .md file

# Complex Markdown Document for Testing

This document includes a variety of Markdown elements to test edge cases in Vale rules, especially for list punctuation.

## Unordered Lists with Different Bullets

- Item with punctuation.
+ Item without punctuation
* Another item with punctuation.

## Nested Lists

- Parent item:
    - Nested item with punctuation.
    - Nested without punctuation
        - Double nested item with punctuation.
        - Double nested without punctuation.

## Ordered Lists Mixed with Unordered

1. First ordered item with punctuation.
2. Second ordered item without punctuation
    - Nested unordered with punctuation.
    + Nested unordered without punctuation

## Inline Formatting within Lists

- **Bold item with punctuation**
- _Italic item without punctuation_
- `Code item with punctuation`

## Links and Images in Lists

- [Link with punctuation](http://example.com).
- ![Image without punctuation](http://example.com/image.jpg)

## Lists with Blockquotes

- > Blockquote with punctuation.
- > Blockquote without punctuation

## Lists with Code Blocks

- Code block with punctuation:

    ```
    Code snippet with punctuation.
    ```

- Code block without punctuation

    ```
    Code snippet without punctuation
    ```

## Mixed Content Lists

- Mixed content with **bold**, _italic_, `code`, [link](http://example.com), and punctuation.
- Mixed content without ending punctuation includes **bold**, _italic_, `code`, and [link](http://example.com)

Remember, this text is designed to test the edge cases of your Vale rule for list punctuation. It includes various types of lists, nested lists, and list items with different types of content and formatting.

Output

image

Issues

  • In output, if we see the first error which is 8:18, the column number is incorrect. It is picking the first n character instead of last.
  • If we the second error which is 9:1, this is false positive. It should not through the error on this line because it already has ending punctuation.
@puneet-ekline
Copy link

Any update on this?

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

No branches or pull requests

2 participants