Skip to content

Refactor anchors case-sensitivity #255

Open
@aeqz

Description

@aeqz

Clarification and motivation

With the solution for #211, Xrefcheck treats anchors as case-sensitive or case-insensitive depending on the configured markdown flavour. However, they are still being represented as Text and we have to take this configuration into account every time that we use them, which can be missed when implementing new features.

A possible solution is to create a wrapper type for anchors and to apply some of the following ideas:

  • Do not allow to compare them unless explicitly taking the configured markdown into account.
  • Make its Eq instance implementation depend on the configured markdown.
  • Allow to extract a canonical (regarding case-sensitivity) Text value from it with a function that depends on the configured markdown, which will be used for comparison-related checks.

Acceptance criteria

  • Having explored the proposed ideas or proposed a new one.
  • Having implemented one of them in order to make the anchors case-sensitivity feature easier to manage and more maintainable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions