diff --git a/examples/full.chapters.json b/examples/full.chapters.json index c1fdff8..1123d13 100644 --- a/examples/full.chapters.json +++ b/examples/full.chapters.json @@ -7,7 +7,7 @@ ] }, { - "slug": "2", + "slug": "2-юникод", "title": "Chapter 2", "chapters": [ diff --git a/examples/full.html b/examples/full.html index 1192053..78c5109 100644 --- a/examples/full.html +++ b/examples/full.html @@ -69,7 +69,7 @@ The Rty Chapter 1 paragraph text

-

Chapter 2

+

Chapter 2

Chapter 2 paragraph text diff --git a/examples/full.repub b/examples/full.repub index c4f91d4..dc27595 100644 --- a/examples/full.repub +++ b/examples/full.repub @@ -41,7 +41,7 @@ end -article.chapter '2', 'Chapter 2' do |chapter| +article.chapter '2-юникод', 'Chapter 2' do |chapter| chapter.paragraph do |paragraph| paragraph.text 'Chapter 2 paragraph text' end diff --git a/lib/repubmark.rb b/lib/repubmark.rb index 8f79d5b..0a5f568 100644 --- a/lib/repubmark.rb +++ b/lib/repubmark.rb @@ -66,7 +66,7 @@ require_relative 'repubmark/elems/footnote' module Repubmark FORMATS = %i[chapters gemtext html summary_plain word_count].freeze - SLUG_RE = /\A\w+(-\w+)*\z/ + SLUG_RE = /\A[[:word:]]+(-[[:word:]]+)*\z/ UNICODE_SUPS = { '0' => '⁰',