[ruby/rdoc] Fix TIDYLINK after braces

(https://github.com/ruby/rdoc/pull/1015)

TIDYLINK multi-word label should not include braces.

https://github.com/ruby/rdoc/commit/41ad3191e9
This commit is contained in:
Nobuyoshi Nakada 2023-11-14 16:23:36 +09:00 коммит произвёл git
Родитель 50e1c293b7
Коммит 9935512275
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -90,7 +90,7 @@ class RDoc::Markup::Formatter
def add_regexp_handling_TIDYLINK def add_regexp_handling_TIDYLINK
@markup.add_regexp_handling(/(?: @markup.add_regexp_handling(/(?:
\{.*?\} | # multi-word label \{[^{}]*\} | # multi-word label
\b[^\s{}]+? # single-word label \b[^\s{}]+? # single-word label
) )

Просмотреть файл

@ -104,6 +104,12 @@ class TestRDocMarkupFormatter < RDoc::TestCase
formatted = document.accept @to formatted = document.accept @to
assert_equal '<{foo}[rdoc-label:bar]>.', formatted assert_equal '<{foo}[rdoc-label:bar]>.', formatted
document = doc(para('<tt>{abc}</tt>: {foo}[rdoc-label:bar].'))
formatted = document.accept @to
assert_equal '<code>{abc}</code>: <{foo}[rdoc-label:bar]>.', formatted
end end
def test_parse_url def test_parse_url