@ozdao/scriptorium 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/scriptorium",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Documentation site generator on @ozdao/martyrs: markdown folders to an SSR site",
5
5
  "author": "OZ DAO <hello@ozdao.com>",
6
6
  "license": "GPL-3.0-or-later",
@@ -32,10 +32,14 @@ const control_characters = /[\u0000-\u001f]/g;
32
32
  const special_characters = /[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g;
33
33
  const combining_marks = /[̀-ͯ]/g;
34
34
 
35
+ // Диакритика снимается только с латиницы (é → e), как у VitePress. Кириллица
36
+ // остаётся целой: «й» и «ё» — отдельные буквы, а не «и» и «е» с надстрочным
37
+ // знаком; без NFC обратно якорь «#семейства» не совпадал бы с заголовком.
35
38
  function slugify(text) {
36
39
  return text
37
40
  .normalize('NFKD')
38
- .replace(combining_marks, '')
41
+ .replace(new RegExp(`(?<=[A-Za-z])${combining_marks.source}+`, 'g'), '')
42
+ .normalize('NFC')
39
43
  .replace(control_characters, '')
40
44
  .replace(special_characters, '-')
41
45
  .replace(/-{2,}/g, '-')