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

Refactor anchors case-sensitivity #255

Open
aeqz opened this issue Dec 21, 2022 · 1 comment
Open

Refactor anchors case-sensitivity #255

aeqz opened this issue Dec 21, 2022 · 1 comment

Comments

@aeqz
Copy link
Contributor

aeqz commented Dec 21, 2022

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.
@Martoon-00
Copy link
Member

Martoon-00 commented Dec 21, 2022

#249 and #243 PR seem to be related; they are about filepaths in Reference type, but effectively suggest a similar thing.

We will have to keep that in mind, and avoid working on any two tasks of these in parallel.

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

No branches or pull requests

2 participants