Allow Unicode slugs

This commit is contained in:
Alex Kotov 2024-10-18 00:04:34 +04:00
parent 51f6355986
commit aaa6256e09
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
4 changed files with 4 additions and 4 deletions

View file

@ -7,7 +7,7 @@
] ]
}, },
{ {
"slug": "2", "slug": "2-юникод",
"title": "Chapter 2", "title": "Chapter 2",
"chapters": [ "chapters": [

View file

@ -69,7 +69,7 @@ The Rty
Chapter 1 paragraph text Chapter 1 paragraph text
</span> </span>
</p> </p>
<h2 id="chapter-2">Chapter 2</h2> <h2 id="chapter-2-юникод">Chapter 2</h2>
<p> <p>
<span> <span>
Chapter 2 paragraph text Chapter 2 paragraph text

View file

@ -41,7 +41,7 @@ end
article.chapter '2', 'Chapter 2' do |chapter| article.chapter '2-юникод', 'Chapter 2' do |chapter|
chapter.paragraph do |paragraph| chapter.paragraph do |paragraph|
paragraph.text 'Chapter 2 paragraph text' paragraph.text 'Chapter 2 paragraph text'
end end

View file

@ -66,7 +66,7 @@ require_relative 'repubmark/elems/footnote'
module Repubmark module Repubmark
FORMATS = %i[chapters gemtext html summary_plain word_count].freeze FORMATS = %i[chapters gemtext html summary_plain word_count].freeze
SLUG_RE = /\A\w+(-\w+)*\z/ SLUG_RE = /\A[[:word:]]+(-[[:word:]]+)*\z/
UNICODE_SUPS = { UNICODE_SUPS = {
'0' => '⁰', '0' => '⁰',