obsidian-export/Cargo.toml
Nick Groenen b5b2ea2c3b
New: apply unicode normalization while resolving notes
The unicode standard allows for certain (visually) identical characters to
be represented in different ways.

For example the character ä may be represented as a single combined
codepoint "Latin Small Letter A with Diaeresis" (U+00E4) or by the
combination of "Latin Small Letter A" (U+0061) followed by "Combining
Diaeresis" (U+0308).

When encoded with UTF-8, these are represented as respectively the two
bytes 0xC3 0xA4, and the three bytes 0x61 0xCC 0x88.

A user linking to notes with these characters in their titles would
expect these two variants to link to the same file, given they are
visually identical and have the exact same semantic meaning.

The unicode standard defines a method to deconstruct and normalize these
forms, so that a byte comparison on the normalized forms of these
variants ends up comparing the same thing. This is called Unicode
Normalization, defined in Unicode® Standard Annex #15
(http://www.unicode.org/reports/tr15/).

The W3C Working Group has written an excellent explanation of the
problems regarding string matching, and how unicode normalization helps
with this process: https://www.w3.org/TR/charmod-norm/#unicodeNormalization

With this change, obsidian-export will perform unicode normalization
(specifically the C (or NFC) normalization form) on all note titles
while looking up link references, ensuring visually identical links are
treated as being similar, even if they were encoded as different
variants.

A special thanks to Hans Raaf (@oderwat) for reporting and helping track
down this issue.

---

Closes #126
2022-11-19 16:58:48 +01:00

49 lines
1.1 KiB
TOML

[package]
name = "obsidian-export"
version = "22.1.0"
authors = ["Nick Groenen <nick@groenen.me>"]
edition = "2018"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/zoni/obsidian-export"
documentation = "https://docs.rs/obsidian-export"
description = """
Rust library and associated CLI program to export an Obsidian vault to regular Markdown.
"""
categories = ["command-line-utilities", "text-processing"]
keywords = ["markdown", "obsidian"]
[lib]
name = "obsidian_export"
path = "src/lib.rs"
[[bin]]
name = "obsidian-export"
path = "src/main.rs"
doc = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
eyre = "0.6.8"
gumdrop = "0.8.1"
ignore = "0.4.18"
lazy_static = "1.4.0"
matter = "0.1.0-alpha4"
pathdiff = "0.2.1"
percent-encoding = "2.2.0"
pulldown-cmark = "0.9.2"
pulldown-cmark-to-cmark = "10.0.4"
rayon = "1.5.3"
regex = "1.7.0"
serde_yaml = "0.9.14"
slug = "0.1.4"
snafu = "0.7.3"
unicode-normalization = "0.1.22"
[dev-dependencies]
pretty_assertions = "1.3.0"
rstest = "0.15.0"
tempfile = "3.3.0"
walkdir = "2.3.2"