Skip to content

Conversation

@digitalmoksha
Copy link
Collaborator

@digitalmoksha digitalmoksha commented May 25, 2023

This escapes footnote names. So [^😄ref] would yield the name %F0%9F%98%84ref

It also makes footnote names case-insensitive but case-preserving. So if the footnote definition is [^aB]: footnote, you can reference it as [^AB] or [^ab], etc. The final name will be the definition name, aB.

Related to #307

@digitalmoksha
Copy link
Collaborator Author

@kivikakk another step on the footnote journey...

There are two commits, one that fixes the encoding of footnote names, the other fixes the case preserving issue.

@kivikakk
Copy link
Owner

Thanks — excellent. One thing you could consider is making a little purpose-built enum for the second argument, so that it looks more like strings::normalize_label(&nfd.name, PreserveCase::DontPreserve), strings::normalize_label(&nfd.name, PreserveCase::Preserve) — or something like that, I'm not sure about what the best wording would be.

@kivikakk kivikakk merged commit 3e4c093 into kivikakk:main May 28, 2023
@digitalmoksha digitalmoksha deleted the bw-escape-footnote-name branch May 31, 2023 15:24
@digitalmoksha
Copy link
Collaborator Author

One thing you could consider is making a little purpose-built enum for the second argument

Ah, I see what you mean. Let me think on it.

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

Successfully merging this pull request may close these issues.

2 participants