mirror of
				https://github.com/theoludwig/markdownlint-rule-relative-links.git
				synced 2025-11-01 00:49:07 +01:00 
			
		
		
		
	feat: stricter validation of heading fragments by being Case sensitive
Fixes #8 BREAKING CHANGE: Heading fragments is now Case sensitive. For example "#ExistIng-Heading" is invalid as it should be "#existing-heading".
This commit is contained in:
		@@ -47,6 +47,14 @@ test("ensure the rule validates correctly", async (t) => {
 | 
			
		||||
          '"./awesome.md#not-an-id-should-be-ignored" should have a valid fragment identifier',
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        name: "should be invalid with uppercase letters in fragment (case sensitive)",
 | 
			
		||||
        fixturePath:
 | 
			
		||||
          "test/fixtures/invalid/invalid-heading-case-sensitive/invalid-heading-case-sensitive.md",
 | 
			
		||||
        errors: [
 | 
			
		||||
          '"./awesome.md#ExistIng-Heading" should have a valid fragment identifier',
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        name: "should be invalid with invalid heading with #L fragment",
 | 
			
		||||
        fixturePath:
 | 
			
		||||
@@ -148,7 +156,11 @@ test("ensure the rule validates correctly", async (t) => {
 | 
			
		||||
          )
 | 
			
		||||
          return result.errorDetail
 | 
			
		||||
        })
 | 
			
		||||
        assert.deepStrictEqual(errorsDetails, errors)
 | 
			
		||||
        assert.deepStrictEqual(
 | 
			
		||||
          errorsDetails,
 | 
			
		||||
          errors,
 | 
			
		||||
          `${fixturePath}: Expected errors`,
 | 
			
		||||
        )
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
@@ -165,11 +177,6 @@ test("ensure the rule validates correctly", async (t) => {
 | 
			
		||||
        fixturePath:
 | 
			
		||||
          "test/fixtures/valid/existing-element-id-fragment/existing-element-id-fragment.md",
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        name: "should be valid with an existing heading fragment (case insensitive)",
 | 
			
		||||
        fixturePath:
 | 
			
		||||
          "test/fixtures/valid/existing-heading-case-insensitive/existing-heading-case-insensitive.md",
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        name: "should be valid with an existing heading fragment",
 | 
			
		||||
        fixturePath:
 | 
			
		||||
@@ -232,7 +239,7 @@ test("ensure the rule validates correctly", async (t) => {
 | 
			
		||||
        assert.equal(
 | 
			
		||||
          errorsDetails.length,
 | 
			
		||||
          0,
 | 
			
		||||
          `Expected no errors, got ${errorsDetails.join(", ")}`,
 | 
			
		||||
          `${fixturePath}: Expected no errors, got ${errorsDetails.join(", ")}`,
 | 
			
		||||
        )
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user